From 8d1da0f5c3b8c6e3fa29e6ae7f891f699a041bb6 Mon Sep 17 00:00:00 2001 From: Florent Xicluna Date: Thu, 1 Apr 2010 18:17:09 +0000 Subject: #7092: Fix some -3 warnings, and fix Lib/platform.py when the path contains a double-quote. --- Lib/platform.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Lib/platform.py') diff --git a/Lib/platform.py b/Lib/platform.py index 080b836580..79695ba11d 100755 --- a/Lib/platform.py +++ b/Lib/platform.py @@ -966,7 +966,7 @@ def _syscmd_file(target,default=''): if sys.platform in ('dos','win32','win16','os2'): # XXX Others too ? return default - target = _follow_symlinks(target) + target = _follow_symlinks(target).replace('"', '\\"') try: f = os.popen('file "%s" 2> %s' % (target, DEV_NULL)) except (AttributeError,os.error): @@ -1032,13 +1032,13 @@ def architecture(executable=sys.executable,bits='',linkage=''): executable == sys.executable: # "file" command did not return anything; we'll try to provide # some sensible defaults then... - if _default_architecture.has_key(sys.platform): - b,l = _default_architecture[sys.platform] + if sys.platform in _default_architecture: + b, l = _default_architecture[sys.platform] if b: bits = b if l: linkage = l - return bits,linkage + return bits, linkage # Split the output into a list of strings omitting the filename fileout = _architecture_split(output)[1:] -- cgit v1.2.1