Patchwork [10,of,18,helps-py3] run-tests: move from dict() construction to {} literals

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

Comments

Augie Fackler - March 12, 2014, 5:40 p.m.
# HG changeset patch
# User Augie Fackler <raf@durin42.com>
# Date 1394644783 14400
#      Wed Mar 12 13:19:43 2014 -0400
# Node ID d3d3e94e2910b11a32cbe319f22059a77026d0de
# Parent  0916f829eb8d0b2bf1d5e8037f55c72b964a9006
run-tests: move from dict() construction to {} literals

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

Patch

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -479,10 +479,10 @@ 
            ' build %(compiler)s --build-base="%(base)s"'
            ' install --force --prefix="%(prefix)s" --install-lib="%(libdir)s"'
            ' --install-scripts="%(bindir)s" %(nohome)s >%(logfile)s 2>&1'
-           % dict(exe=sys.executable, py3=py3, pure=pure, compiler=compiler,
-                  base=os.path.join(HGTMP, "build"),
-                  prefix=INST, libdir=PYTHONDIR, bindir=BINDIR,
-                  nohome=nohome, logfile=installerrs))
+           % {'exe': sys.executable, 'py3': py3, 'pure': pure,
+              'compiler': compiler, 'base': os.path.join(HGTMP, "build"),
+              'prefix': INST, 'libdir': PYTHONDIR, 'bindir': BINDIR,
+              'nohome': nohome, 'logfile': installerrs})
     vlog("# Running", cmd)
     if os.system(cmd) == 0:
         if not options.verbose: