Author: guido.van.rossum
Date: Fri Nov  2 21:50:29 2007
New Revision: 58802

Modified:
   python/branches/py3k-pep3137/Lib/base64.py
Log:
Fix simple bytes/buffer issues in base64.py.


Modified: python/branches/py3k-pep3137/Lib/base64.py
==============================================================================
--- python/branches/py3k-pep3137/Lib/base64.py  (original)
+++ python/branches/py3k-pep3137/Lib/base64.py  Fri Nov  2 21:50:29 2007
@@ -28,9 +28,9 @@
 
 
 def _translate(s, altchars):
-    if not isinstance(s, bytes):
+    if not isinstance(s, (bytes, buffer)):
         raise TypeError("expected bytes, not %s" % s.__class__.__name__)
-    translation = bytes(range(256))
+    translation = buffer(range(256))
     for k, v in altchars.items():
         translation[ord(k)] = v[0]
     return s.translate(translation)
_______________________________________________
Python-3000-checkins mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000-checkins

Reply via email to