]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
use os and os.path
authorGuido van Rossum <guido@python.org>
Tue, 31 Mar 1992 19:07:25 +0000 (19:07 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 31 Mar 1992 19:07:25 +0000 (19:07 +0000)
Lib/lib-stdwin/DirList.py
Lib/stdwin/DirList.py

index 0066c58fe9987057eb2d87e9b6281f6bb0665e9d..00e9a8c50993a95ed673f1684e9d9be8e09b5800 100644 (file)
@@ -2,14 +2,7 @@
 
 # XXX Displays messy paths when following '..'
 
-try:
-       import posix, path
-       os = posix
-except ImportError:
-       import mac, macpath
-       os = mac
-       path = macpath
-
+import os
 import stdwin, rect
 from stdwinevents import *
 from Buttons import PushButton
@@ -22,8 +15,8 @@ class DirList(VSplit):
                self = VSplit.create(self, parent)
                names = os.listdir(dirname)
                for name in names:
-                       if path.isdir(path.join(dirname, name)):
-                               fullname = path.join(dirname, name)
+                       if os.path.isdir(os.path.join(dirname, name)):
+                               fullname = os.path.join(dirname, name)
                                btn = SubdirButton().definetext(self, fullname)
                        elif name[-3:] == '.py':
                                btn = ModuleButton().definetext(self, name)
index 0066c58fe9987057eb2d87e9b6281f6bb0665e9d..00e9a8c50993a95ed673f1684e9d9be8e09b5800 100755 (executable)
@@ -2,14 +2,7 @@
 
 # XXX Displays messy paths when following '..'
 
-try:
-       import posix, path
-       os = posix
-except ImportError:
-       import mac, macpath
-       os = mac
-       path = macpath
-
+import os
 import stdwin, rect
 from stdwinevents import *
 from Buttons import PushButton
@@ -22,8 +15,8 @@ class DirList(VSplit):
                self = VSplit.create(self, parent)
                names = os.listdir(dirname)
                for name in names:
-                       if path.isdir(path.join(dirname, name)):
-                               fullname = path.join(dirname, name)
+                       if os.path.isdir(os.path.join(dirname, name)):
+                               fullname = os.path.join(dirname, name)
                                btn = SubdirButton().definetext(self, fullname)
                        elif name[-3:] == '.py':
                                btn = ModuleButton().definetext(self, name)