summaryrefslogtreecommitdiffstats
path: root/Lib/plat-mac
diff options
context:
space:
mode:
authorRonald Oussoren <ronaldoussoren@mac.com>2010-05-05 19:09:31 (GMT)
committerRonald Oussoren <ronaldoussoren@mac.com>2010-05-05 19:09:31 (GMT)
commit9545a23c7ffb35417d451d24cc3b0339627965a7 (patch)
tree5e22fd30c1c6936970b4d87ca3e91f8428c74983 /Lib/plat-mac
parenta8157183b89c08cf47c969185d40973ec21a81c5 (diff)
downloadcpython-9545a23c7ffb35417d451d24cc3b0339627965a7.zip
cpython-9545a23c7ffb35417d451d24cc3b0339627965a7.tar.gz
cpython-9545a23c7ffb35417d451d24cc3b0339627965a7.tar.bz2
In a number of places code still revers
to "sys.platform == 'mac'" and that is dead code because it refers to a platform that is no longer supported (and hasn't been supported for several releases). Fixes issue #7908 for the trunk.
Diffstat (limited to 'Lib/plat-mac')
-rw-r--r--Lib/plat-mac/EasyDialogs.py17
-rwxr-xr-xLib/plat-mac/bundlebuilder.py2
2 files changed, 8 insertions, 11 deletions
diff --git a/Lib/plat-mac/EasyDialogs.py b/Lib/plat-mac/EasyDialogs.py
index 785fd3b..129cf2c 100644
--- a/Lib/plat-mac/EasyDialogs.py
+++ b/Lib/plat-mac/EasyDialogs.py
@@ -721,16 +721,13 @@ def AskFileForSave(
if issubclass(tpwanted, Carbon.File.FSSpec):
return tpwanted(rr.selection[0])
if issubclass(tpwanted, (str, unicode)):
- if sys.platform == 'mac':
- fullpath = rr.selection[0].as_pathname()
- else:
- # This is gross, and probably incorrect too
- vrefnum, dirid, name = rr.selection[0].as_tuple()
- pardir_fss = Carbon.File.FSSpec((vrefnum, dirid, ''))
- pardir_fsr = Carbon.File.FSRef(pardir_fss)
- pardir_path = pardir_fsr.FSRefMakePath() # This is utf-8
- name_utf8 = unicode(name, 'macroman').encode('utf8')
- fullpath = os.path.join(pardir_path, name_utf8)
+ # This is gross, and probably incorrect too
+ vrefnum, dirid, name = rr.selection[0].as_tuple()
+ pardir_fss = Carbon.File.FSSpec((vrefnum, dirid, ''))
+ pardir_fsr = Carbon.File.FSRef(pardir_fss)
+ pardir_path = pardir_fsr.FSRefMakePath() # This is utf-8
+ name_utf8 = unicode(name, 'macroman').encode('utf8')
+ fullpath = os.path.join(pardir_path, name_utf8)
if issubclass(tpwanted, unicode):
return unicode(fullpath, 'utf8')
return tpwanted(fullpath)
diff --git a/Lib/plat-mac/bundlebuilder.py b/Lib/plat-mac/bundlebuilder.py
index ce7ce45..4339913 100755
--- a/Lib/plat-mac/bundlebuilder.py
+++ b/Lib/plat-mac/bundlebuilder.py
@@ -273,7 +273,7 @@ __load()
del __load
"""
-MAYMISS_MODULES = ['mac', 'os2', 'nt', 'ntpath', 'dos', 'dospath',
+MAYMISS_MODULES = ['os2', 'nt', 'ntpath', 'dos', 'dospath',
'win32api', 'ce', '_winreg', 'nturl2path', 'sitecustomize',
'org.python.core', 'riscos', 'riscosenviron', 'riscospath'
]