summaryrefslogtreecommitdiff
path: root/Lib/platform.py
diff options
context:
space:
mode:
authorFlorent Xicluna <florent.xicluna@gmail.com>2010-04-01 18:17:09 +0000
committerFlorent Xicluna <florent.xicluna@gmail.com>2010-04-01 18:17:09 +0000
commit8d1da0f5c3b8c6e3fa29e6ae7f891f699a041bb6 (patch)
tree358d9d15191ea717dcd05117302d090296a4e9c1 /Lib/platform.py
parentb5023df3d6d46c7a220eb1db0c2db8cbe8a881fc (diff)
downloadcpython-git-8d1da0f5c3b8c6e3fa29e6ae7f891f699a041bb6.tar.gz
#7092: Fix some -3 warnings, and fix Lib/platform.py when the path contains a double-quote.
Diffstat (limited to 'Lib/platform.py')
-rwxr-xr-xLib/platform.py8
1 files changed, 4 insertions, 4 deletions
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:]