[Python-3000-checkins] r59036 - python/branches/py3k/Lib/distutils/msvccompiler.py

christian.heimes python-3000-checkins at python.org
Sat Nov 17 12:46:54 CET 2007


Author: christian.heimes
Date: Sat Nov 17 12:46:54 2007
New Revision: 59036

Modified:
   python/branches/py3k/Lib/distutils/msvccompiler.py
Log:
The _winreg module returns bytes which must be decoded to unicode, not encoded.

Modified: python/branches/py3k/Lib/distutils/msvccompiler.py
==============================================================================
--- python/branches/py3k/Lib/distutils/msvccompiler.py	(original)
+++ python/branches/py3k/Lib/distutils/msvccompiler.py	Sat Nov 17 12:46:54 2007
@@ -93,10 +93,10 @@
     return d
 
 def convert_mbcs(s):
-    enc = getattr(s, "encode", None)
-    if enc is not None:
+    dec = getattr(s, "decode", None)
+    if dec is not None:
         try:
-            s = enc("mbcs")
+            s = dec("mbcs")
         except UnicodeError:
             pass
     return s


More information about the Python-3000-checkins mailing list