[Python-checkins] r58169 - sandbox/trunk/import_in_py/importlib.py

brett.cannon python-checkins at python.org
Mon Sep 17 00:33:44 CEST 2007


Author: brett.cannon
Date: Mon Sep 17 00:33:44 2007
New Revision: 58169

Modified:
   sandbox/trunk/import_in_py/importlib.py
Log:
Rename a local variable to not shadow the bytes type in Py3K.


Modified: sandbox/trunk/import_in_py/importlib.py
==============================================================================
--- sandbox/trunk/import_in_py/importlib.py	(original)
+++ sandbox/trunk/import_in_py/importlib.py	Mon Sep 17 00:33:44 2007
@@ -53,24 +53,24 @@
 
     """
     x = int(x)
-    bytes = []
-    bytes.append(x & 0xFF)
-    bytes.append((x >> 8) & 0xFF)
-    bytes.append((x >> 16) & 0xFF)
-    bytes.append((x >> 24) & 0xFF)
-    return ''.join(chr(x) for x in bytes)
+    int_bytes = []
+    int_bytes.append(x & 0xFF)
+    int_bytes.append((x >> 8) & 0xFF)
+    int_bytes.append((x >> 16) & 0xFF)
+    int_bytes.append((x >> 24) & 0xFF)
+    return ''.join(chr(x) for x in int_bytes)
 
 
-def _r_long(bytes):
+def _r_long(int_bytes):
     """Convert 4 bytes in little-endian to an integer.
 
     XXX Temporary until marshal's long function are exposed.
 
     """
-    x = ord(bytes[0])
-    x |= ord(bytes[1]) << 8
-    x |= ord(bytes[2]) << 16
-    x |= ord(bytes[3]) << 24
+    x = ord(int_bytes[0])
+    x |= ord(int_bytes[1]) << 8
+    x |= ord(int_bytes[2]) << 16
+    x |= ord(int_bytes[3]) << 24
     return x
 
 


More information about the Python-checkins mailing list