Patchwork [15,of,18,helps-py3] test-url: move from dict() construction to {} literals

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

Comments

Augie Fackler - March 12, 2014, 5:40 p.m.
# HG changeset patch
# User Augie Fackler <raf@durin42.com>
# Date 1394644877 14400
#      Wed Mar 12 13:21:17 2014 -0400
# Node ID 56b1f39dd0c11dbe8c6188fe3e248c5578073816
# Parent  2761a791b113b84060b2df7bf25407f759293992
test-url: move from dict() construction to {} literals

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

Patch

diff --git a/tests/test-url.py b/tests/test-url.py
--- a/tests/test-url.py
+++ b/tests/test-url.py
@@ -5,7 +5,7 @@ 
         print (a, b)
 
 def cert(cn):
-    return dict(subject=((('commonName', cn),),))
+    return {'subject': ((('commonName', cn),),)}
 
 from mercurial.sslutil import _verifycert