]> granicus.if.org Git - python/commitdiff
In a number of places code still revers
authorRonald Oussoren <ronaldoussoren@mac.com>
Wed, 5 May 2010 19:09:31 +0000 (19:09 +0000)
committerRonald Oussoren <ronaldoussoren@mac.com>
Wed, 5 May 2010 19:09:31 +0000 (19:09 +0000)
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.

30 files changed:
Demo/pdist/FSProxy.py
Doc/library/os.rst
Lib/binhex.py
Lib/distutils/command/install.py
Lib/distutils/file_util.py
Lib/distutils/sysconfig.py
Lib/distutils/util.py
Lib/imputil.py
Lib/plat-mac/EasyDialogs.py
Lib/plat-mac/bundlebuilder.py
Lib/platform.py
Lib/profile.py
Lib/pydoc.py
Lib/tarfile.py
Lib/test/regrtest.py
Lib/test/test_frozen.py
Lib/test/test_repr.py
Lib/test/test_select.py
Lib/test/test_socket.py
Lib/test/test_strptime.py
Lib/test/test_tempfile.py
Lib/test/test_urllib2.py
Lib/urllib.py
Mac/scripts/BuildApplet.py
Mac/scripts/zappycfiles.py
Misc/BeOS-setup.py
Misc/cheatsheet
Tools/webchecker/wcgui.py
Tools/webchecker/websucker.py
setup.py

index a1ab635c08bafd4b5c051ab912a974b06c27beaa..871c84f9c79ac7d07215404e838e93d19e4dbab9 100644 (file)
@@ -23,12 +23,7 @@ from stat import *
 import time
 import fnmatch
 
-if os.name == 'mac':
-    import macfs
-    maxnamelen = 31
-else:
-    macfs = None
-    maxnamelen = 255
+maxnamelen = 255
 
 skipnames = (os.curdir, os.pardir)
 
@@ -63,16 +58,10 @@ class FSProxyLocal:
         return ignore
 
     def _hidden(self, name):
-        if os.name == 'mac':
-            return name[0] == '(' and name[-1] == ')'
-        else:
-            return name[0] == '.'
+        return name[0] == '.'
 
     def _hide(self, name):
-        if os.name == 'mac':
-            return '(%s)' % name
-        else:
-            return '.%s' % name
+        return '.%s' % name
 
     def visible(self, name):
         if len(name) > maxnamelen: return 0
@@ -81,18 +70,8 @@ class FSProxyLocal:
         if self._hidden(name): return 0
         head, tail = os.path.split(name)
         if head or not tail: return 0
-        if macfs:
-            if os.path.exists(name) and not os.path.isdir(name):
-                try:
-                    fs = macfs.FSSpec(name)
-                    c, t = fs.GetCreatorType()
-                    if t != 'TEXT': return 0
-                except macfs.error, msg:
-                    print "***", name, msg
-                    return 0
-        else:
-            if os.path.islink(name): return 0
-            if '\0' in open(name, 'rb').read(512): return 0
+        if os.path.islink(name): return 0
+        if '\0' in open(name, 'rb').read(512): return 0
         for ign in self._ignore:
             if fnmatch.fnmatch(name, ign): return 0
         return 1
index 6777196f763fa72910304f7ce7c56b6646e8cbad..77f867bd8e760f7728275ab6bae25cbd147417ad 100644 (file)
@@ -47,7 +47,7 @@ Notes on the availability of these functions:
 .. data:: name
 
    The name of the operating system dependent module imported.  The following
-   names have currently been registered: ``'posix'``, ``'nt'``, ``'mac'``,
+   names have currently been registered: ``'posix'``, ``'nt'``,
    ``'os2'``, ``'ce'``, ``'java'``, ``'riscos'``.
 
 
index bd4e8b3015b5b354be8071b2668ad7b1fe7112e6..8abc9f3e14c17a2f7421e8a7472993bb686047f4 100644 (file)
@@ -175,9 +175,6 @@ class BinHex:
         if type(ofp) == type(''):
             ofname = ofp
             ofp = open(ofname, 'w')
-            if os.name == 'mac':
-                fss = FSSpec(ofname)
-                fss.SetCreatorType('BnHq', 'TEXT')
         ofp.write('(This file must be converted with BinHex 4.0)\n\n:')
         hqxer = _Hqxcoderengine(ofp)
         self.ofp = _Rlecoderengine(hqxer)
@@ -478,9 +475,6 @@ def hexbin(inp, out):
     finfo = ifp.FInfo
     if not out:
         out = ifp.FName
-    if os.name == 'mac':
-        ofss = FSSpec(out)
-        out = ofss.as_pathname()
 
     ofp = open(out, 'wb')
     # XXXX Do translation on non-mac systems
@@ -501,13 +495,6 @@ def hexbin(inp, out):
             ofp.write(d)
         ofp.close()
 
-    if os.name == 'mac':
-        nfinfo = ofss.GetFInfo()
-        nfinfo.Creator = finfo.Creator
-        nfinfo.Type = finfo.Type
-        nfinfo.Flags = finfo.Flags
-        ofss.SetFInfo(nfinfo)
-
     ifp.close()
 
 def _test():
index 44c76926ea678d10fec82abc330e67a26e7ce07c..f1f3bd5c6f5d26a5cfdb90fc3aa826c600b892c7 100644 (file)
@@ -69,20 +69,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',
index d8e8fd5f8d9e9dd86a125566b70645edf3ac6c0d..b3d9d54ec025691f0f2232dcfa2348b1309fd2a4 100644 (file)
@@ -133,18 +133,9 @@ 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, exc:
-            raise DistutilsFileError(
-                  "could not copy '%s' to '%s': %s" % (src, dst, exc[-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':
+    if link == 'hard':
         if not (os.path.exists(dst) and os.path.samefile(src, dst)):
             os.link(src, dst)
     elif link == 'sym':
index bb53315bcad7b46f0df33f6581e52c82058ba93b..4d16b2674c066bd3cd4bc5e49ff915bb5cdc2f5a 100644 (file)
@@ -88,11 +88,6 @@ def get_python_inc(plat_specific=0, prefix=None):
         return os.path.join(prefix, "include", "python" + get_python_version())
     elif os.name == "nt":
         return os.path.join(prefix, "include")
-    elif os.name == "mac":
-        if plat_specific:
-            return os.path.join(prefix, "Mac", "Include")
-        else:
-            return os.path.join(prefix, "Include")
     elif os.name == "os2":
         return os.path.join(prefix, "Include")
     else:
@@ -135,18 +130,6 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
             else:
                 return os.path.join(prefix, "Lib", "site-packages")
 
-    elif os.name == "mac":
-        if plat_specific:
-            if standard_lib:
-                return os.path.join(prefix, "Lib", "lib-dynload")
-            else:
-                return os.path.join(prefix, "Lib", "site-packages")
-        else:
-            if standard_lib:
-                return os.path.join(prefix, "Lib")
-            else:
-                return os.path.join(prefix, "Lib", "site-packages")
-
     elif os.name == "os2":
         if standard_lib:
             return os.path.join(prefix, "Lib")
index 994dd211be1dc505655a1aa75ae438c6963e4b70..b3ec6e9606a70b2bc77ad7685f50625d78252b8d 100644 (file)
@@ -235,15 +235,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 = string.split(pathname, ":", 1)
-            pathname = ":" + elements[1]
-            return os.path.join(new_root, pathname)
-
     else:
         raise DistutilsPlatformError, \
               "nothing known about platform '%s'" % os.name
index 600cfa51aa1796e217d6fbb624c27006c70cd7ae..a5fa6ea4f768220f55811a2f9c28c3b82920e9d0 100644 (file)
@@ -462,16 +462,6 @@ def _os_bootstrap():
     elif 'os2' in names:
         sep = '\\'
         from os2 import stat
-    elif 'mac' in names:
-        from mac import stat
-        def join(a, b):
-            if a == '':
-                return b
-            if ':' not in a:
-                a = ':' + a
-            if a[-1:] != ':':
-                a = a + ':'
-            return a + b
     else:
         raise ImportError, 'no os specific module found'
 
index 785fd3bd7420171fbf28db861360d2c6dc0db35c..129cf2cae2678b36f8117e2f09c384cfb64a3623 100644 (file)
@@ -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)
index ce7ce45be9b066396c120268c4d5406fa89bb90c..433991394deb9e4792821055cdb5043ae8f9dcab 100755 (executable)
@@ -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'
 ]
index 79695ba11de80ef062ba4e4991529b9d54ee6b13..66764360a10028cd4e776eca9cfba7c492a2cf66 100755 (executable)
@@ -1171,10 +1171,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
index 3af84278bf2284af9933a0c3fb16a005196f4f35..9a4336ec474614fe42159b7897f1f2af2657bdd3 100755 (executable)
@@ -97,11 +97,6 @@ def help():
     print "Documentation for the profile module can be found "
     print "in the Python Library Reference, section 'The Python Profiler'."
 
-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()
@@ -178,10 +173,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
index dd7eb38f2ca12e799d31a1dfe4c004273e781455..4d6043672238849fb37ed590d2c0526e2c86545a 100755 (executable)
@@ -2028,7 +2028,7 @@ pydoc</strong> by Ka-Ping Yee &lt;ping@lfw.org&gt;</font>'''
 
     class DocServer(BaseHTTPServer.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
@@ -2145,10 +2145,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)
index b0af5b15b3ea9e87d9b6c0b626ef029e0edd350c..4b03c28305841defb6d5e9ea4323392750a923ef 100644 (file)
@@ -53,13 +53,6 @@ import copy
 import re
 import operator
 
-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:
index 545e0ea2b83c8f3b96b0cc6941bcf73ad44a490d..a4139d313dfe617be4b29855518ba2f9e1b1449d 100755 (executable)
@@ -1156,41 +1156,6 @@ _expectations = {
         test_kqueue
         test_ossaudiodev
         """,
-   'mac':
-        """
-        test_atexit
-        test_bsddb
-        test_bsddb185
-        test_bsddb3
-        test_bz2
-        test_commands
-        test_crypt
-        test_curses
-        test_dbm
-        test_dl
-        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_popen2
-        test_posix
-        test_pty
-        test_pwd
-        test_resource
-        test_signal
-        test_sundry
-        test_tarfile
-        test_timing
-        """,
     'unixware7':
         """
         test_bsddb
@@ -1477,7 +1442,7 @@ class _ExpectedSkips:
             if sys.maxint == 9223372036854775807L:
                 self.expected.add('test_imageop')
 
-            if not sys.platform in ("mac", "darwin"):
+            if sys.platform != "darwin":
                 MAC_ONLY = ["test_macos", "test_macostools", "test_aepack",
                             "test_plistlib", "test_scriptpackages",
                             "test_applesingle"]
index 5f72a92e227a46d0fb8ff959548aef3118bc536f..7fb53a4ba6ed789c2ea067bb5ab1e2a8ab52e177 100644 (file)
@@ -23,13 +23,12 @@ class FrozenTests(unittest.TestCase):
             except ImportError, x:
                 self.fail("import __phello__.spam failed:" + str(x))
 
-            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")
 
         self.assertEquals(stdout.getvalue(),
                           'Hello world...\nHello world...\nHello world...\n')
index 26300d374583a21856f8459e71ebdaf10e1d3ca3..a8202eec595aa965c5cda2788d94f6cdaccdeece 100644 (file)
@@ -320,8 +320,7 @@ class ClassWithFailingRepr:
 
 def test_main():
     run_unittest(ReprTests)
-    if os.name != 'mac':
-        run_unittest(LongReprTest)
+    run_unittest(LongReprTest)
 
 
 if __name__ == "__main__":
index 647d71ef20946c7dbe2134acb6ba9ad23eb59fa2..79b249bf411033d5ff8431d98fbbd3520767a4e8 100644 (file)
@@ -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):
 
index 0ce329f12c55ba70d3e03eb5f77ebbdcf5bef6d6..430a6474ed1555a5cb3005a3815daa48698f1889 100644 (file)
@@ -1383,9 +1383,8 @@ 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,
index d2868e99e226cd31d9a95004091d61627d751b8f..a233b1c3bf1db0ca9e46c5190648432b1e093396 100644 (file)
@@ -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
index e534d62b5162ae67bb32cc0fcb466800ce2b2daa..27068e3295a0d23874d121d6657b3e5905a0d7d6 100644 (file)
@@ -23,9 +23,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
@@ -257,7 +255,7 @@ class test__mkstemp_inner(TC):
         file = self.do_create()
         mode = stat.S_IMODE(os.stat(file.name).st_mode)
         expected = 0600
-        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
@@ -476,7 +474,7 @@ class test_mkdtemp(TC):
             mode = stat.S_IMODE(os.stat(dir).st_mode)
             mode &= 0777 # Mask off sticky bits inherited from /tmp
             expected = 0700
-            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
index c0366dd18fcc55c2ff4e8e3915e617a0e1fcff3d..01a06fb8561c416a1c225d0d436bf298060003d5 100644 (file)
@@ -24,9 +24,7 @@ class TrivialTests(unittest.TestCase):
 
         # And more hacking to get it to work on MacOS. This assumes
         # urllib.pathname2url works, unfortunately...
-        if os.name == 'mac':
-            fname = '/' + fname.replace(':', '/')
-        elif os.name == 'riscos':
+        if os.name == 'riscos':
             import string
             fname = os.expand(fname)
             fname = fname.translate(string.maketrans("/.", "./"))
index 652be754b6efa20673f29760ab7fcdbd9a10f5d8..6cb95f3db8c73583c52bf031c4e8b6544d5e375e 100644 (file)
@@ -42,9 +42,7 @@ __version__ = '1.17'    # XXX This version is not always updated :-(
 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
 elif os.name == 'riscos':
     from rourl2path import url2pathname, pathname2url
index eeeb82bfd7c14895702a53fd5ec5de5eeef602ab..a76ed90872d9b7a1dcf269245e28bd5bd6f81b72 100644 (file)
@@ -112,9 +112,6 @@ def buildapplet():
                 usage()
             elif opt in ('-d', '--destroot'):
                 destroot = arg
-        # On OS9 always be verbose
-        if sys.platform == 'mac' and not verbose:
-            verbose = 'default'
         # Loop over all files to be processed
         for filename in args:
             cr, tp = MacOS.GetCreatorAndType(filename)
index d829159dac07675d8a913842c66a5357ad4c2197..6d3574877d9c941ed344360c5c9c9d1dedf1fffc 100644 (file)
@@ -9,15 +9,8 @@ doit = 1
 
 def main():
     if not sys.argv[1:]:
-        if os.name == 'mac':
-            import EasyDialogs
-            dir = EasyDialogs.AskFolder(message='Directory to zap pyc files in')
-            if not dir:
-                sys.exit(0)
-            zappyc(dir)
-        else:
-            print 'Usage: zappyc dir ...'
-            sys.exit(1)
+        print 'Usage: zappyc dir ...'
+        sys.exit(1)
     for dir in sys.argv[1:]:
         zappyc(dir)
 
index c5e02cc70ac299f1302d9b251228ccbfcb753af7..2b4cb1fda0af5f53d2bbd3035ab3ee64841b24a5 100644 (file)
@@ -356,7 +356,7 @@ class PyBuildExt(build_ext):
                                    libraries = dblib) )
 
         # Unix-only modules
-        if platform not in ['mac', 'win32']:
+        if platform == 'win32':
             # Steen Lumholt's termios module
             exts.append( Extension('termios', ['termios.c']) )
             # Jeremy Hylton's rlimit interface
index 98e3399ff9d0352e71c4a5f420d9c65f1df4cab9..d8784246fa19b6a59059c335c8dcbf1afc6fdce8 100644 (file)
@@ -1390,7 +1390,7 @@ platform.py)
 
                                Some os variables
      Variable                                 Meaning
-name                name of O/S-specific module (e.g. "posix", "mac", "nt")
+name                name of O/S-specific module (e.g. "posix", "nt")
 path                O/S-specific module for path manipulations.
                     On Unix, os.path.split() <=> posixpath.split()
 curdir              string used to represent current directory ('.')
index cfc4098ef84a6a206d82f1f634ace58dd00722ca..cd5326379d6b1c46a129f3d7e077ef818fa33319 100755 (executable)
@@ -64,12 +64,6 @@ from Tkinter import *
 import tktools
 import webchecker
 
-# Override some for a weaker platform
-if sys.platform == 'mac':
-    webchecker.DEFROOT = "http://grail.cnri.reston.va.us/"
-    webchecker.MAXPAGE = 50000
-    webchecker.verbose = 4
-
 def main():
     try:
         opts, args = getopt.getopt(sys.argv[1:], 't:m:qva')
index ef2fa44d7e08a321a4094b310cebf4cbb1789403..df4c8e1b2e5ddfe524cefe035078c459f865798b 100755 (executable)
@@ -97,8 +97,6 @@ class Sucker(webchecker.Checker):
             path = path + "index.html"
         if os.sep != "/":
             path = os.sep.join(path.split("/"))
-            if os.name == "mac":
-                path = os.sep + path
         path = os.path.join(host, path)
         return path
 
index 08e819e93768ed92d03216e8b525db8f8e3be161..7d6cadaf402a2ace996b96e99161dc56c348bde1 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -127,7 +127,7 @@ class PyBuildExt(build_ext):
         # Platform-dependent module source and include directories
         incdirlist = []
         platform = self.get_platform()
-        if platform in ('darwin', 'mac') and ("--disable-toolbox-glue" not in
+        if platform == 'darwin' and ("--disable-toolbox-glue" not in
             sysconfig.get_config_var("CONFIG_ARGS")):
             # Mac OS X also includes some mac-specific modules
             macmoddir = os.path.join(srcdir, 'Mac/Modules')
@@ -160,22 +160,21 @@ class PyBuildExt(build_ext):
             if ext.name in sys.builtin_module_names:
                 self.extensions.remove(ext)
 
-        if platform != 'mac':
-            # Parse Modules/Setup and Modules/Setup.local to figure out which
-            # modules are turned on in the file.
-            remove_modules = []
-            for filename in ('Modules/Setup', 'Modules/Setup.local'):
-                input = text_file.TextFile(filename, join_lines=1)
-                while 1:
-                    line = input.readline()
-                    if not line: break
-                    line = line.split()
-                    remove_modules.append(line[0])
-                input.close()
-
-            for ext in self.extensions[:]:
-                if ext.name in remove_modules:
-                    self.extensions.remove(ext)
+        # Parse Modules/Setup and Modules/Setup.local to figure out which
+        # modules are turned on in the file.
+        remove_modules = []
+        for filename in ('Modules/Setup', 'Modules/Setup.local'):
+            input = text_file.TextFile(filename, join_lines=1)
+            while 1:
+                line = input.readline()
+                if not line: break
+                line = line.split()
+                remove_modules.append(line[0])
+            input.close()
+
+        for ext in self.extensions[:]:
+            if ext.name in remove_modules:
+                self.extensions.remove(ext)
 
         # When you run "make CC=altcc" or something similar, you really want
         # those environment variables passed into the setup.py phase.  Here's
@@ -397,7 +396,7 @@ class PyBuildExt(build_ext):
 
         # Check for MacOS X, which doesn't need libm.a at all
         math_libs = ['m']
-        if platform in ['darwin', 'beos', 'mac']:
+        if platform in ['darwin', 'beos']:
             math_libs = []
 
         # XXX Omitted modules: gl, pure, dl, SGI-specific modules
@@ -485,19 +484,16 @@ class PyBuildExt(build_ext):
 
         # fcntl(2) and ioctl(2)
         exts.append( Extension('fcntl', ['fcntlmodule.c']) )
-        if platform not in ['mac']:
-            # pwd(3)
-            exts.append( Extension('pwd', ['pwdmodule.c']) )
-            # grp(3)
-            exts.append( Extension('grp', ['grpmodule.c']) )
-            # spwd, shadow passwords
-            if (config_h_vars.get('HAVE_GETSPNAM', False) or
-                    config_h_vars.get('HAVE_GETSPENT', False)):
-                exts.append( Extension('spwd', ['spwdmodule.c']) )
-            else:
-                missing.append('spwd')
+        # pwd(3)
+        exts.append( Extension('pwd', ['pwdmodule.c']) )
+        # grp(3)
+        exts.append( Extension('grp', ['grpmodule.c']) )
+        # spwd, shadow passwords
+        if (config_h_vars.get('HAVE_GETSPNAM', False) or
+                config_h_vars.get('HAVE_GETSPENT', False)):
+            exts.append( Extension('spwd', ['spwdmodule.c']) )
         else:
-            missing.extend(['pwd', 'grp', 'spwd'])
+            missing.append('spwd')
 
         # select(2); not on ancient System V
         exts.append( Extension('select', ['selectmodule.c']) )
@@ -510,17 +506,14 @@ class PyBuildExt(build_ext):
         exts.append( Extension('cPickle', ['cPickle.c']) )
 
         # Memory-mapped files (also works on Win32).
-        if platform not in ['atheos', 'mac']:
+        if platform not in ['atheos']:
             exts.append( Extension('mmap', ['mmapmodule.c']) )
         else:
             missing.append('mmap')
 
         # Lance Ellinghaus's syslog module
-        if platform not in ['mac']:
-            # syslog daemon interface
-            exts.append( Extension('syslog', ['syslogmodule.c']) )
-        else:
-            missing.append('syslog')
+        # syslog daemon interface
+        exts.append( Extension('syslog', ['syslogmodule.c']) )
 
         # George Neville-Neil's timing module:
         # Deprecated in PEP 4 http://www.python.org/peps/pep-0004.html
@@ -592,16 +585,13 @@ class PyBuildExt(build_ext):
         else:
             missing.append('readline')
 
-        if platform not in ['mac']:
-            # crypt module.
+        # crypt module.
 
-            if self.compiler.find_library_file(lib_dirs, 'crypt'):
-                libs = ['crypt']
-            else:
-                libs = []
-            exts.append( Extension('crypt', ['cryptmodule.c'], libraries=libs) )
+        if self.compiler.find_library_file(lib_dirs, 'crypt'):
+            libs = ['crypt']
         else:
-            missing.append('crypt')
+            libs = []
+        exts.append( Extension('crypt', ['cryptmodule.c'], libraries=libs) )
 
         # CSV files
         exts.append( Extension('_csv', ['_csv.c']) )
@@ -1093,7 +1083,7 @@ class PyBuildExt(build_ext):
             missing.append('gdbm')
 
         # Unix-only modules
-        if platform not in ['mac', 'win32']:
+        if platform not in ['win32']:
             # Steen Lumholt's termios module
             exts.append( Extension('termios', ['termios.c']) )
             # Jeremy Hylton's rlimit interface