From: Thomas Heller Date: Fri, 8 Feb 2002 14:41:31 +0000 (+0000) Subject: Make it 1.5.2 compatible again. X-Git-Tag: v2.3c1~6725 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=745b4609cb932a493033b1b7d7e851716ac8e413;p=thirdparty%2FPython%2Fcpython.git Make it 1.5.2 compatible again. --- diff --git a/Lib/distutils/msvccompiler.py b/Lib/distutils/msvccompiler.py index 35336642ae70..79a4901bea15 100644 --- a/Lib/distutils/msvccompiler.py +++ b/Lib/distutils/msvccompiler.py @@ -117,10 +117,11 @@ def get_msvc_paths (path, version='6.0', platform='x86'): if string.upper(p) == path: V = string.split(v,';') for v in V: - try: - v = v.encode("mbcs") - except UnicodeError: - pass + if hasattr(v, "encode"): + try: + v = v.encode("mbcs") + except UnicodeError: + pass if v == '' or v in L: continue L.append(v) break