[pypy-commit] pypy py3k: 2to3

pjenvey noreply at buildbot.pypy.org
Wed May 7 00:25:32 CEST 2014


Author: Philip Jenvey <pjenvey at underboss.org>
Branch: py3k
Changeset: r71350:89063808e736
Date: 2014-05-06 15:24 -0700
http://bitbucket.org/pypy/pypy/changeset/89063808e736/

Log:	2to3

diff --git a/pypy/module/cppyy/test/test_datatypes.py b/pypy/module/cppyy/test/test_datatypes.py
--- a/pypy/module/cppyy/test/test_datatypes.py
+++ b/pypy/module/cppyy/test/test_datatypes.py
@@ -158,15 +158,15 @@
         # integer types
         names = ['short', 'ushort', 'int', 'uint', 'long', 'ulong', 'llong', 'ullong']
         for i in range(len(names)):
-            exec 'c.m_%s = %d' % (names[i],i)
+            exec('c.m_%s = %d' % (names[i],i))
             assert eval('c.get_%s()' % names[i]) == i
 
         for i in range(len(names)):
-            exec 'c.set_%s(%d)' % (names[i],2*i)
+            exec('c.set_%s(%d)' % (names[i],2*i))
             assert eval('c.m_%s' % names[i]) == 2*i
 
         for i in range(len(names)):
-            exec 'c.set_%s_c(%d)' % (names[i],3*i)
+            exec('c.set_%s_c(%d)' % (names[i],3*i))
             assert eval('c.m_%s' % names[i]) == 3*i
 
         # float types through functions
@@ -191,11 +191,11 @@
         atypes = ['h', 'H', 'i', 'I', 'l', 'L' ]
         for j in range(len(names)):
             b = array.array(atypes[j], a)
-            exec 'c.m_%s_array = b' % names[j]   # buffer copies
+            exec('c.m_%s_array = b' % names[j])   # buffer copies
             for i in range(self.N):
                 assert eval('c.m_%s_array[i]' % names[j]) == b[i]
 
-            exec 'c.m_%s_array2 = b' % names[j]  # pointer copies
+            exec('c.m_%s_array2 = b' % names[j])  # pointer copies
             b[i] = 28
             for i in range(self.N):
                 assert eval('c.m_%s_array2[i]' % names[j]) == b[i]
@@ -264,14 +264,14 @@
         assert c.s_int                  == -202
         assert c.s_uint                 ==  202
         assert cppyy_test_data.s_uint   ==  202
-        assert cppyy_test_data.s_long   == -303L
-        assert c.s_long                 == -303L
-        assert c.s_ulong                ==  303L
-        assert cppyy_test_data.s_ulong  ==  303L
-        assert cppyy_test_data.s_llong  == -404L
-        assert c.s_llong                == -404L
-        assert c.s_ullong               ==  505L
-        assert cppyy_test_data.s_ullong ==  505L
+        assert cppyy_test_data.s_long   == -303
+        assert c.s_long                 == -303
+        assert c.s_ulong                ==  303
+        assert cppyy_test_data.s_ulong  ==  303
+        assert cppyy_test_data.s_llong  == -404
+        assert c.s_llong                == -404
+        assert c.s_ullong               ==  505
+        assert cppyy_test_data.s_ullong ==  505
 
         # floating point types
         assert round(cppyy_test_data.s_float  + 606., 5) == 0
@@ -321,14 +321,14 @@
         assert cppyy_test_data.s_uint   == 4321
         raises(ValueError, setattr, c,               's_uint', -1)
         raises(ValueError, setattr, cppyy_test_data, 's_uint', -1)
-        cppyy_test_data.s_long           = -87L
-        assert c.s_long                 == -87L
-        c.s_long                         = 876L
-        assert cppyy_test_data.s_long   == 876L
-        cppyy_test_data.s_ulong          = 876L
-        assert c.s_ulong                == 876L
-        c.s_ulong                        = 678L
-        assert cppyy_test_data.s_ulong  == 678L
+        cppyy_test_data.s_long           = -87
+        assert c.s_long                 == -87
+        c.s_long                         = 876
+        assert cppyy_test_data.s_long   == 876
+        cppyy_test_data.s_ulong          = 876
+        assert c.s_ulong                == 876
+        c.s_ulong                        = 678
+        assert cppyy_test_data.s_ulong  == 678
         raises(ValueError, setattr, cppyy_test_data, 's_ulong', -1)
         raises(ValueError, setattr, c,               's_ulong', -1)
 
diff --git a/pypy/module/cppyy/test/test_pythonify.py b/pypy/module/cppyy/test/test_pythonify.py
--- a/pypy/module/cppyy/test/test_pythonify.py
+++ b/pypy/module/cppyy/test/test_pythonify.py
@@ -44,8 +44,6 @@
         res = example01_class.staticAddOneToInt(1)
         assert res == 2
 
-        res = example01_class.staticAddOneToInt(1L)
-        assert res == 2
         res = example01_class.staticAddOneToInt(1, 2)
         assert res == 4
         res = example01_class.staticAddOneToInt(-1)
@@ -118,7 +116,7 @@
         res = instance.addToStringValue("-12")   # TODO: this leaks
         assert res == "30"
 
-        res = instance.staticAddOneToInt(1L)
+        res = instance.staticAddOneToInt(1)
         assert res == 2
 
         instance.destruct()


More information about the pypy-commit mailing list