Author: Ronan Lamy <ronan.l...@gmail.com>
Branch: py3.5
Changeset: r92316:2db2c4a66195
Date: 2017-09-04 14:51 +0100
http://bitbucket.org/pypy/pypy/changeset/2db2c4a66195/

Log:    fix merge issues

diff --git a/lib-python/3/ctypes/test/test_byteswap.py 
b/lib-python/3/ctypes/test/test_byteswap.py
--- a/lib-python/3/ctypes/test/test_byteswap.py
+++ b/lib-python/3/ctypes/test/test_byteswap.py
@@ -2,7 +2,6 @@
 from binascii import hexlify
 
 from ctypes import *
-from ctypes.test import xfail
 
 def bin(s):
     return hexlify(memoryview(s)).decode().upper()
@@ -43,7 +42,6 @@
         with self.assertRaises(AttributeError):
             little.z = 24
 
-    @xfail
     def test_endian_short(self):
         if sys.byteorder == "little":
             self.assertIs(c_short.__ctype_le__, c_short)
@@ -71,7 +69,6 @@
         self.assertEqual(bin(s), "3412")
         self.assertEqual(s.value, 0x1234)
 
-    @xfail
     def test_endian_int(self):
         if sys.byteorder == "little":
             self.assertIs(c_int.__ctype_le__, c_int)
@@ -100,7 +97,6 @@
         self.assertEqual(bin(s), "78563412")
         self.assertEqual(s.value, 0x12345678)
 
-    @xfail
     def test_endian_longlong(self):
         if sys.byteorder == "little":
             self.assertIs(c_longlong.__ctype_le__, c_longlong)
@@ -129,7 +125,6 @@
         self.assertEqual(bin(s), "EFCDAB9078563412")
         self.assertEqual(s.value, 0x1234567890ABCDEF)
 
-    @xfail
     def test_endian_float(self):
         if sys.byteorder == "little":
             self.assertIs(c_float.__ctype_le__, c_float)
@@ -148,7 +143,6 @@
         self.assertAlmostEqual(s.value, math.pi, places=6)
         self.assertEqual(bin(struct.pack(">f", math.pi)), bin(s))
 
-    @xfail
     def test_endian_double(self):
         if sys.byteorder == "little":
             self.assertIs(c_double.__ctype_le__, c_double)
@@ -176,7 +170,6 @@
         self.assertIs(c_char.__ctype_le__, c_char)
         self.assertIs(c_char.__ctype_be__, c_char)
 
-    @xfail
     def test_struct_fields_1(self):
         if sys.byteorder == "little":
             base = BigEndianStructure
@@ -212,7 +205,6 @@
                 pass
             self.assertRaises(TypeError, setattr, T, "_fields_", [("x", typ)])
 
-    @xfail
     def test_struct_struct(self):
         # nested structures with different byteorders
 
@@ -241,7 +233,6 @@
                 self.assertEqual(s.point.x, 1)
                 self.assertEqual(s.point.y, 2)
 
-    @xfail
     def test_struct_fields_2(self):
         # standard packing in struct uses no alignment.
         # So, we have to align using pad bytes.
@@ -265,7 +256,6 @@
         s2 = struct.pack(fmt, 0x12, 0x1234, 0x12345678, 3.14)
         self.assertEqual(bin(s1), bin(s2))
 
-    @xfail
     def test_unaligned_nonnative_struct_fields(self):
         if sys.byteorder == "little":
             base = BigEndianStructure
diff --git a/lib_pypy/_ctypes/primitive.py b/lib_pypy/_ctypes/primitive.py
--- a/lib_pypy/_ctypes/primitive.py
+++ b/lib_pypy/_ctypes/primitive.py
@@ -72,13 +72,13 @@
                ((value >> 24) & 0xFF)
 
     def swap_8():
-        return ((value & 0x00000000000000FFL) << 56) | \
-               ((value & 0x000000000000FF00L) << 40) | \
-               ((value & 0x0000000000FF0000L) << 24) | \
-               ((value & 0x00000000FF000000L) << 8) | \
-               ((value & 0x000000FF00000000L) >> 8) | \
-               ((value & 0x0000FF0000000000L) >> 24) | \
-               ((value & 0x00FF000000000000L) >> 40) | \
+        return ((value & 0x00000000000000FF) << 56) | \
+               ((value & 0x000000000000FF00) << 40) | \
+               ((value & 0x0000000000FF0000) << 24) | \
+               ((value & 0x00000000FF000000) << 8) | \
+               ((value & 0x000000FF00000000) >> 8) | \
+               ((value & 0x0000FF0000000000) >> 24) | \
+               ((value & 0x00FF000000000000) >> 40) | \
                ((value >> 56) & 0xFF)
 
     def swap_double_float(typ):
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to