]> granicus.if.org Git - python/commitdiff
Renamed 'native_path()' to 'convert_path()'.
authorGreg Ward <gward@python.net>
Wed, 31 May 2000 02:32:10 +0000 (02:32 +0000)
committerGreg Ward <gward@python.net>
Wed, 31 May 2000 02:32:10 +0000 (02:32 +0000)
Also changed it so it doesn't barf if the path is already in native format
  (ie. contains os.sep).

Lib/distutils/command/install.py
Lib/distutils/command/sdist.py
Lib/distutils/util.py

index 13fa88ee19d975bb0bee6251a083d4a01bbc6cd7..7176fab890f80fadaf14786f36d24c8cda093ef3 100644 (file)
@@ -10,7 +10,7 @@ import sys, os, string
 from types import *
 from distutils.core import Command, DEBUG
 from distutils import sysconfig
-from distutils.util import write_file, native_path, subst_vars, change_root
+from distutils.util import write_file, convert_path, subst_vars, change_root
 from distutils.errors import DistutilsOptionError
 from glob import glob
 
@@ -423,7 +423,7 @@ class install (Command):
 
             # convert to local form in case Unix notation used (as it
             # should be in setup scripts)
-            extra_dirs = native_path (extra_dirs)
+            extra_dirs = convert_path (extra_dirs)
 
         else:
             path_file = None
index 6626b9e66a74347a0ce05fc22a7734137562bdfe..c06860fb65a5d2db7e82e5f974026b751190a43e 100644 (file)
@@ -11,7 +11,7 @@ import fnmatch
 from types import *
 from glob import glob
 from distutils.core import Command
-from distutils.util import newer, create_tree, remove_tree, native_path, \
+from distutils.util import newer, create_tree, remove_tree, convert_path, \
      write_file
 from distutils.archive_util import check_archive_formats
 from distutils.text_file import TextFile
@@ -322,7 +322,7 @@ class sdist (Command):
                          action)
                     continue
 
-                pattern_list = map(native_path, words[1:])
+                pattern_list = map(convert_path, words[1:])
 
             elif action in ('recursive-include','recursive-exclude'):
                 if len (words) < 3:
@@ -332,8 +332,8 @@ class sdist (Command):
                          action)
                     continue
 
-                dir = native_path(words[1])
-                pattern_list = map (native_path, words[2:])
+                dir = convert_path(words[1])
+                pattern_list = map (convert_path, words[2:])
 
             elif action in ('graft','prune'):
                 if len (words) != 2:
@@ -343,7 +343,7 @@ class sdist (Command):
                          action)
                     continue
 
-                dir_pattern = native_path (words[1])
+                dir_pattern = convert_path (words[1])
 
             else:
                 template.warn ("invalid manifest template line: " +
index 6063aa6847f07a94f848b783455908020e402575..575463843b8890f27a860759c09ad345e155bc83 100644 (file)
@@ -58,7 +58,7 @@ def get_platform ():
 # get_platform()
 
 
-def native_path (pathname):
+def convert_path (pathname):
     """Return 'pathname' as a name that will work on the native
        filesystem, i.e. split it on '/' and put it back together again
        using the current directory separator.  Needed because filenames in
@@ -73,16 +73,12 @@ def native_path (pathname):
     if pathname[-1] == '/':
         raise ValueError, "path '%s' cannot end with '/'" % pathname
     if os.sep != '/':
-       if os.sep in pathname:
-            raise ValueError, \
-              "path '%s' cannot contain '%c' character" % (pathname, os.sep)
-       else:
-            paths = string.split (pathname, '/')
-            return apply (os.path.join, paths)
+        paths = string.split (pathname, '/')
+        return apply (os.path.join, paths)
     else:
         return pathname
 
-# native_path ()
+# convert_path ()
 
 
 def change_root (new_root, pathname):