Patchwork [17,of,18,helps-py3] setup.py: move from dict() construction to {} literals

login
register
mail settings
Submitter Augie Fackler
Date March 12, 2014, 5:40 p.m.
Message ID <7d4d04299927ab9cba7b.1394646051@augie-macbookair>
Download mbox | patch
Permalink /patch/3924/
State Accepted
Commit 7d4d04299927ab9cba7bef9e3b474120a1a84292
Headers show

Comments

Augie Fackler - March 12, 2014, 5:40 p.m.
# HG changeset patch
# User Augie Fackler <raf@durin42.com>
# Date 1394645369 14400
#      Wed Mar 12 13:29:29 2014 -0400
# Node ID 7d4d04299927ab9cba7bef9e3b474120a1a84292
# Parent  c69f62906358d91ef3a45ff561c2260540bd034e
setup.py: move from dict() construction to {} literals

The latter are both faster and more consistent across Python 2 and 3.

Patch

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -554,9 +554,11 @@ 
       package_data=packagedata,
       cmdclass=cmdclass,
       distclass=hgdist,
-      options=dict(py2exe=dict(packages=['hgext', 'email']),
-                   bdist_mpkg=dict(zipdist=True,
-                                   license='COPYING',
-                                   readme='contrib/macosx/Readme.html',
-                                   welcome='contrib/macosx/Welcome.html')),
+      options={'py2exe': {'packages': ['hgext', 'email']},
+               'bdist_mpkg': {'zipdist': True,
+                              'license': 'COPYING',
+                              'readme': 'contrib/macosx/Readme.html',
+                              'welcome': 'contrib/macosx/Welcome.html',
+                              },
+               },
       **extra)