Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5c1d229

Browse files
committed
Instead of 'import mac', use 'import os' -- this way, the path syntax
manipulation routines can be used on non-Mac platforms (e.g. to manipulate pathnames in a Mac specific archive).
1 parent 69f6580 commit 5c1d229

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

Lib/macpath.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# module 'macpath' -- pathname (or -related) operations for the Macintosh
22

33
import string
4-
import mac
4+
import os
55
from stat import *
66

77

@@ -93,8 +93,8 @@ def basename(s): return split(s)[1]
9393

9494
def isdir(s):
9595
try:
96-
st = mac.stat(s)
97-
except mac.error:
96+
st = os.stat(s)
97+
except os.error:
9898
return 0
9999
return S_ISDIR(st[ST_MODE])
100100

@@ -110,8 +110,8 @@ def islink(s):
110110

111111
def isfile(s):
112112
try:
113-
st = mac.stat(s)
114-
except mac.error:
113+
st = os.stat(s)
114+
except os.error:
115115
return 0
116116
return S_ISREG(st[ST_MODE])
117117

@@ -120,8 +120,8 @@ def isfile(s):
120120

121121
def exists(s):
122122
try:
123-
st = mac.stat(s)
124-
except mac.error:
123+
st = os.stat(s)
124+
except os.error:
125125
return 0
126126
return 1
127127

@@ -186,8 +186,8 @@ def normpath(s):
186186

187187
def walk(top, func, arg):
188188
try:
189-
names = mac.listdir(top)
190-
except mac.error:
189+
names = os.listdir(top)
190+
except os.error:
191191
return
192192
func(arg, top, names)
193193
for name in names:

0 commit comments

Comments
 (0)