summaryrefslogtreecommitdiffstats
path: root/Lib/platform.py
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2010-08-02 20:26:41 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2010-08-02 20:26:41 (GMT)
commitb55d36805566c092c11b8e38792c759742cd6a1f (patch)
treefbe9279c4c088fd4c9a0ee557ff76494ffe584f7 /Lib/platform.py
parent507ea2ae1802a97fe3cd88051413219d70cb71e1 (diff)
downloadcpython-b55d36805566c092c11b8e38792c759742cd6a1f.zip
cpython-b55d36805566c092c11b8e38792c759742cd6a1f.tar.gz
cpython-b55d36805566c092c11b8e38792c759742cd6a1f.tar.bz2
Merged revisions 79558 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r79558 | florent.xicluna | 2010-04-01 21:17:09 +0300 (Thu, 01 Apr 2010) | 2 lines #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 aba2c33..9e7ee5f 100755
--- a/Lib/platform.py
+++ b/Lib/platform.py
@@ -1012,7 +1012,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> /dev/null' % target)
except (AttributeError,os.error):
@@ -1078,13 +1078,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:]