]> granicus.if.org Git - python/commitdiff
Getting rid of macfs.
authorJack Jansen <jack.jansen@cwi.nl>
Thu, 27 Feb 2003 23:18:46 +0000 (23:18 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Thu, 27 Feb 2003 23:18:46 +0000 (23:18 +0000)
Lib/macpath.py
Lib/py_compile.py
Lib/test/test_macostools.py

index 8277d41b17b6a90b7e60a517ee5f56455d2773c0..695fac913289d77fe93aa9bb43b88e63fc776cd9 100644 (file)
@@ -129,8 +129,8 @@ def islink(s):
     """Return true if the pathname refers to a symbolic link."""
 
     try:
-        import macfs
-        return macfs.ResolveAliasFile(s)[2]
+        import Carbon.File
+        return Carbon.File.ResolveAliasFile(s, 0)[2]
     except:
         return False
 
@@ -247,7 +247,7 @@ def abspath(path):
 def realpath(path):
     path = abspath(path)
     try:
-        import macfs
+        import Carbon.File
     except ImportError:
         return path
     if not path:
@@ -256,7 +256,7 @@ def realpath(path):
     path = components[0] + ':'
     for c in components[1:]:
         path = join(path, c)
-        path = macfs.ResolveAliasFile(path)[0].as_pathname()
+        path = Carbon.File.FSResolveAliasFile(path, 1)[0].as_pathname()
     return path
 
 supports_unicode_filenames = False
index 2f4206d4d5b30404fcb1ebdbd3d9e5ebb5b8324d..02b01363ac64c424cc7b660170a6c6ddcdbf66c7 100644 (file)
@@ -63,9 +63,9 @@ class PyCompileError(Exception):
 
 # Define an internal helper according to the platform
 if os.name == "mac":
-    import macfs
+    import MacOS
     def set_creator_type(file):
-        macfs.FSSpec(file).SetCreatorType('Pyth', 'PYC ')
+        MacOS.SetCreatorAndType(file, 'Pyth', 'PYC ')
 else:
     def set_creator_type(file):
         pass
index d9578bb20e2f3c17279a81275ba1bbd08a90b776..9ed2d81094e26e5c142b2aeec242433777d7192b 100644 (file)
@@ -2,7 +2,7 @@
 
 import unittest
 import macostools
-import macfs
+import Carbon.File
 import MacOS
 import os
 import sys
@@ -67,7 +67,7 @@ class TestMacostools(unittest.TestCase):
         except:
             pass
         macostools.mkalias(test_support.TESTFN, TESTFN2)
-        fss, _, _ = macfs.ResolveAliasFile(TESTFN2)
+        fss, _, _ = Carbon.File.ResolveAliasFile(TESTFN2, 0)
         self.assertEqual(fss.as_pathname(), os.path.realpath(test_support.TESTFN))
 
     def test_mkalias_relative(self):
@@ -76,7 +76,7 @@ class TestMacostools(unittest.TestCase):
         except:
             pass
         macostools.mkalias(test_support.TESTFN, TESTFN2, sys.prefix)
-        fss, _, _ = macfs.ResolveAliasFile(TESTFN2)
+        fss, _, _ = Carbon.File.ResolveAliasFile(TESTFN2, 0)
         self.assertEqual(fss.as_pathname(), os.path.realpath(test_support.TESTFN))