Author: Armin Rigo <[email protected]>
Branch: 
Changeset: r911:311388c97d50
Date: 2012-09-03 22:15 +0200
http://bitbucket.org/cffi/cffi/changeset/311388c97d50/

Log:    Disable encode('utf-8') on Python 2, where it makes no sense and
        just adds to the confusion

diff --git a/cffi/verifier.py b/cffi/verifier.py
--- a/cffi/verifier.py
+++ b/cffi/verifier.py
@@ -14,7 +14,9 @@
         self.kwds = kwds
         #
         key = '\x00'.join(['1', sys.version[:3], __version__, preamble] +
-                          ffi._cdefsources).encode('utf-8')
+                          ffi._cdefsources)
+        if sys.version_info >= (3,):
+            key = key.encode('utf-8')
         k1 = hex(binascii.crc32(key[0::2]) & 0xffffffff)
         k1 = k1.lstrip('0x').rstrip('L')
         k2 = hex(binascii.crc32(key[1::2]) & 0xffffffff)
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to