From d157e6977784c9483bdffc5d8ccd108c3cd4f94f Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Sat, 17 Nov 2007 11:46:54 +0000 Subject: The _winreg module returns bytes which must be decoded to unicode, not encoded. --- Lib/distutils/msvccompiler.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Lib/distutils/msvccompiler.py b/Lib/distutils/msvccompiler.py index d239057..6bf969f 100644 --- a/Lib/distutils/msvccompiler.py +++ b/Lib/distutils/msvccompiler.py @@ -93,10 +93,10 @@ def read_values(base, key): 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 -- cgit v0.12