summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorRonald Oussoren <ronaldoussoren@mac.com>2010-05-05 19:11:21 (GMT)
committerRonald Oussoren <ronaldoussoren@mac.com>2010-05-05 19:11:21 (GMT)
commit94f25283c9b6cb43791e23618b9bec0cc961a7cb (patch)
treec32622183a1e7020de5afb458288be48449a60a6 /Lib
parenta045f191b4670bbf201d6d56a50886694c26da3e (diff)
downloadcpython-94f25283c9b6cb43791e23618b9bec0cc961a7cb.zip
cpython-94f25283c9b6cb43791e23618b9bec0cc961a7cb.tar.gz
cpython-94f25283c9b6cb43791e23618b9bec0cc961a7cb.tar.bz2
Remove traces of MacOS9 support.
Fix for issue #7908
Diffstat (limited to 'Lib')
-rw-r--r--Lib/distutils/command/install.py14
-rw-r--r--Lib/distutils/file_util.py9
-rw-r--r--Lib/distutils/util.py9
-rwxr-xr-xLib/platform.py4
-rwxr-xr-xLib/profile.py9
-rwxr-xr-xLib/pydoc.py6
-rw-r--r--Lib/tarfile.py7
-rwxr-xr-xLib/test/regrtest.py28
-rw-r--r--Lib/test/test_frozen.py13
-rw-r--r--Lib/test/test_reprlib.py3
-rw-r--r--Lib/test/test_select.py2
-rw-r--r--Lib/test/test_socket.py4
-rw-r--r--Lib/test/test_strptime.py5
-rw-r--r--Lib/test/test_tempfile.py8
-rw-r--r--Lib/test/test_urllib2.py5
-rw-r--r--Lib/urllib/request.py4
16 files changed, 14 insertions, 116 deletions
diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py
index 31d0387..3c28c66 100644
--- a/Lib/distutils/command/install.py
+++ b/Lib/distutils/command/install.py
@@ -65,20 +65,6 @@ INSTALL_SCHEMES = {
'scripts': '$userbase/Scripts',
'data' : '$userbase',
},
- 'mac': {
- 'purelib': '$base/Lib/site-packages',
- 'platlib': '$base/Lib/site-packages',
- 'headers': '$base/Include/$dist_name',
- 'scripts': '$base/Scripts',
- 'data' : '$base',
- },
- 'mac_user': {
- 'purelib': '$usersite',
- 'platlib': '$usersite',
- 'headers': '$userbase/$py_version_short/include/$dist_name',
- 'scripts': '$userbase/bin',
- 'data' : '$userbase',
- },
'os2': {
'purelib': '$base/Lib/site-packages',
'platlib': '$base/Lib/site-packages',
diff --git a/Lib/distutils/file_util.py b/Lib/distutils/file_util.py
index 758bde3..3a71bfd 100644
--- a/Lib/distutils/file_util.py
+++ b/Lib/distutils/file_util.py
@@ -132,15 +132,6 @@ def copy_file(src, dst, preserve_mode=1, preserve_times=1, update=0,
if dry_run:
return (dst, 1)
- # On Mac OS, use the native file copy routine
- if os.name == 'mac':
- import macostools
- try:
- macostools.copy(src, dst, 0, preserve_times)
- except os.error as exc:
- raise DistutilsFileError(
- "could not copy '%s' to '%s': %s" % (src, dst, exc.args[-1]))
-
# If linking (hard or symbolic), use the appropriate system call
# (Unix only, of course, but that's the caller's responsibility)
elif link == 'hard':
diff --git a/Lib/distutils/util.py b/Lib/distutils/util.py
index 8fd2ca0..c8bf006 100644
--- a/Lib/distutils/util.py
+++ b/Lib/distutils/util.py
@@ -91,15 +91,6 @@ def change_root(new_root, pathname):
path = path[1:]
return os.path.join(new_root, path)
- elif os.name == 'mac':
- if not os.path.isabs(pathname):
- return os.path.join(new_root, pathname)
- else:
- # Chop off volume name from start of path
- elements = pathname.split(":", 1)
- pathname = ":" + elements[1]
- return os.path.join(new_root, pathname)
-
else:
raise DistutilsPlatformError("nothing known about "
"platform '%s'" % os.name)
diff --git a/Lib/platform.py b/Lib/platform.py
index 1601d59..8d8fede 100755
--- a/Lib/platform.py
+++ b/Lib/platform.py
@@ -1147,10 +1147,6 @@ def uname():
if not version:
version = vendor
- elif os.name == 'mac':
- release,(version,stage,nonrel),machine = mac_ver()
- system = 'MacOS'
-
# System specific extensions
if system == 'OpenVMS':
# OpenVMS seems to have release and version mixed up
diff --git a/Lib/profile.py b/Lib/profile.py
index 8d68d17..0255bba 100755
--- a/Lib/profile.py
+++ b/Lib/profile.py
@@ -92,11 +92,6 @@ def runctx(statement, globals, locals, filename=None):
else:
return prof.print_stats()
-if os.name == "mac":
- import MacOS
- def _get_time_mac(timer=MacOS.GetTicks):
- return timer() / 60.0
-
if hasattr(os, "times"):
def _get_time_times(timer=os.times):
t = timer()
@@ -173,10 +168,6 @@ class Profile:
self.timer = resgetrusage
self.dispatcher = self.trace_dispatch
self.get_time = _get_time_resource
- elif os.name == 'mac':
- self.timer = MacOS.GetTicks
- self.dispatcher = self.trace_dispatch_mac
- self.get_time = _get_time_mac
elif hasattr(time, 'clock'):
self.timer = self.get_time = time.clock
self.dispatcher = self.trace_dispatch_i
diff --git a/Lib/pydoc.py b/Lib/pydoc.py
index 208740f..2722a75 100755
--- a/Lib/pydoc.py
+++ b/Lib/pydoc.py
@@ -2024,7 +2024,7 @@ pydoc</strong> by Ka-Ping Yee &lt;ping@lfw.org&gt;</font>'''
class DocServer(http.server.HTTPServer):
def __init__(self, port, callback):
- host = (sys.platform == 'mac') and '127.0.0.1' or 'localhost'
+ host = 'localhost'
self.address = ('', port)
self.url = 'http://%s:%d/' % (host, port)
self.callback = callback
@@ -2141,10 +2141,6 @@ def gui():
except ImportError: # pre-webbrowser.py compatibility
if sys.platform == 'win32':
os.system('start "%s"' % url)
- elif sys.platform == 'mac':
- try: import ic
- except ImportError: pass
- else: ic.launchurl(url)
else:
rc = os.system('netscape -remote "openURL(%s)" &' % url)
if rc: os.system('netscape "%s" &' % url)
diff --git a/Lib/tarfile.py b/Lib/tarfile.py
index 9ca8494..a888d69 100644
--- a/Lib/tarfile.py
+++ b/Lib/tarfile.py
@@ -50,13 +50,6 @@ import struct
import copy
import re
-if sys.platform == 'mac':
- # This module needs work for MacOS9, especially in the area of pathname
- # handling. In many places it is assumed a simple substitution of / by the
- # local os.path.sep is good enough to convert pathnames, but this does not
- # work with the mac rooted:path:name versus :nonrooted:path:name syntax
- raise ImportError("tarfile does not work for platform==mac")
-
try:
import grp, pwd
except ImportError:
diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py
index a4ebff4..e92a3f7 100755
--- a/Lib/test/regrtest.py
+++ b/Lib/test/regrtest.py
@@ -1209,34 +1209,6 @@ _expectations = {
test_kqueue
test_ossaudiodev
""",
- 'mac':
- """
- test_atexit
- test_bz2
- test_crypt
- test_curses
- test_dbm
- test_fcntl
- test_fork1
- test_epoll
- test_grp
- test_ioctl
- test_largefile
- test_locale
- test_kqueue
- test_mmap
- test_openpty
- test_ossaudiodev
- test_poll
- test_popen
- test_posix
- test_pty
- test_pwd
- test_resource
- test_signal
- test_sundry
- test_tarfile
- """,
'unixware7':
"""
test_epoll
diff --git a/Lib/test/test_frozen.py b/Lib/test/test_frozen.py
index 28186bb..11a366c 100644
--- a/Lib/test/test_frozen.py
+++ b/Lib/test/test_frozen.py
@@ -39,13 +39,12 @@ class FrozenTests(unittest.TestCase):
else:
self.fail("import __phello__.foo should have failed")
- if sys.platform != "mac": # On the Mac this import does succeed.
- try:
- import __phello__.foo
- except ImportError:
- pass
- else:
- self.fail("import __phello__.foo should have failed")
+ try:
+ import __phello__.foo
+ except ImportError:
+ pass
+ else:
+ self.fail("import __phello__.foo should have failed")
del sys.modules['__hello__']
del sys.modules['__phello__']
diff --git a/Lib/test/test_reprlib.py b/Lib/test/test_reprlib.py
index 627482c..0e799f6 100644
--- a/Lib/test/test_reprlib.py
+++ b/Lib/test/test_reprlib.py
@@ -304,8 +304,7 @@ class ClassWithFailingRepr:
def test_main():
run_unittest(ReprTests)
- if os.name != 'mac':
- run_unittest(LongReprTest)
+ run_unittest(LongReprTest)
if __name__ == "__main__":
diff --git a/Lib/test/test_select.py b/Lib/test/test_select.py
index 8813c6e..fe92f45 100644
--- a/Lib/test/test_select.py
+++ b/Lib/test/test_select.py
@@ -4,7 +4,7 @@ import select
import os
import sys
-@unittest.skipIf(sys.platform[:3] in ('win', 'mac', 'os2', 'riscos'),
+@unittest.skipIf(sys.platform[:3] in ('win', 'os2', 'riscos'),
"can't easily test on this system")
class SelectTestCase(unittest.TestCase):
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
index 76d870b..25025dd 100644
--- a/Lib/test/test_socket.py
+++ b/Lib/test/test_socket.py
@@ -1465,9 +1465,7 @@ class TIPCThreadableTest (unittest.TestCase, ThreadableTest):
def test_main():
tests = [GeneralModuleTests, BasicTCPTest, TCPCloserTest, TCPTimeoutTest,
- TestExceptions, BufferIOTest, BasicTCPTest2]
- if sys.platform != 'mac':
- tests.extend([ BasicUDPTest, UDPTimeoutTest ])
+ TestExceptions, BufferIOTest, BasicTCPTest2, BasicUDPTest, UDPTimeoutTest ]
tests.extend([
NonBlockingTCPTests,
diff --git a/Lib/test/test_strptime.py b/Lib/test/test_strptime.py
index 9f1bb44..77d3789 100644
--- a/Lib/test/test_strptime.py
+++ b/Lib/test/test_strptime.py
@@ -298,9 +298,6 @@ class StrptimeTests(unittest.TestCase):
self.assertEqual(strp_output.tm_isdst, 0)
strp_output = _strptime._strptime_time("GMT", "%Z")
self.assertEqual(strp_output.tm_isdst, 0)
- if sys.platform == "mac":
- # Timezones don't really work on MacOS9
- return
time_tuple = time.localtime()
strf_output = time.strftime("%Z") #UTC does not have a timezone
strp_output = _strptime._strptime_time(strf_output, "%Z")
@@ -317,8 +314,6 @@ class StrptimeTests(unittest.TestCase):
def test_bad_timezone(self):
# Explicitly test possibility of bad timezone;
# when time.tzname[0] == time.tzname[1] and time.daylight
- if sys.platform == "mac":
- return #MacOS9 has severely broken timezone support.
tz_name = time.tzname[0]
if tz_name.upper() in ("UTC", "GMT"):
return
diff --git a/Lib/test/test_tempfile.py b/Lib/test/test_tempfile.py
index 823c3d4..b0976d2 100644
--- a/Lib/test/test_tempfile.py
+++ b/Lib/test/test_tempfile.py
@@ -20,9 +20,7 @@ has_spawnl = hasattr(os, 'spawnl')
# TEST_FILES may need to be tweaked for systems depending on the maximum
# number of files that can be opened at one time (see ulimit -n)
-if sys.platform == 'mac':
- TEST_FILES = 32
-elif sys.platform in ('openbsd3', 'openbsd4'):
+if sys.platform in ('openbsd3', 'openbsd4'):
TEST_FILES = 48
else:
TEST_FILES = 100
@@ -265,7 +263,7 @@ class test__mkstemp_inner(TC):
file = self.do_create()
mode = stat.S_IMODE(os.stat(file.name).st_mode)
expected = 0o600
- if sys.platform in ('win32', 'os2emx', 'mac'):
+ if sys.platform in ('win32', 'os2emx'):
# There's no distinction among 'user', 'group' and 'world';
# replicate the 'user' bits.
user = expected >> 6
@@ -488,7 +486,7 @@ class test_mkdtemp(TC):
mode = stat.S_IMODE(os.stat(dir).st_mode)
mode &= 0o777 # Mask off sticky bits inherited from /tmp
expected = 0o700
- if sys.platform in ('win32', 'os2emx', 'mac'):
+ if sys.platform in ('win32', 'os2emx'):
# There's no distinction among 'user', 'group' and 'world';
# replicate the 'user' bits.
user = expected >> 6
diff --git a/Lib/test/test_urllib2.py b/Lib/test/test_urllib2.py
index 11848e0..1a8ffac 100644
--- a/Lib/test/test_urllib2.py
+++ b/Lib/test/test_urllib2.py
@@ -22,11 +22,6 @@ class TrivialTests(unittest.TestCase):
# XXX Name hacking to get this to work on Windows.
fname = os.path.abspath(urllib.request.__file__).replace('\\', '/')
- # And more hacking to get it to work on MacOS. This assumes
- # urllib.pathname2url works, unfortunately...
- if os.name == 'mac':
- fname = '/' + fname.replace(':', '/')
-
if os.name == 'nt':
file_url = "file:///%s" % fname
else:
diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py
index ff871f9..3293966 100644
--- a/Lib/urllib/request.py
+++ b/Lib/urllib/request.py
@@ -1338,9 +1338,7 @@ class CacheFTPHandler(FTPHandler):
MAXFTPCACHE = 10 # Trim the ftp cache beyond this size
# Helper for non-unix systems
-if os.name == 'mac':
- from macurl2path import url2pathname, pathname2url
-elif os.name == 'nt':
+if os.name == 'nt':
from nturl2path import url2pathname, pathname2url
else:
def url2pathname(pathname):