]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Backport theller's check-in of revision 1.45:
authorMichael W. Hudson <mwh@python.net>
Fri, 22 Feb 2002 13:55:28 +0000 (13:55 +0000)
committerMichael W. Hudson <mwh@python.net>
Fri, 22 Feb 2002 13:55:28 +0000 (13:55 +0000)
Make it 1.5.2 compatible again.

(I'm not sure how having symlinks around the repository interacts with
branches -- I'm going to tread carefully in here)

Lib/distutils/msvccompiler.py

index 35336642ae704f6f86e9ae13d3392acba59dbf42..79a4901bea1575b567ec788683d03500d0d76d0d 100644 (file)
@@ -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