[Python-checkins] CVS: distutils/distutils util.py,1.45,1.46

Greg Ward python-dev@python.org
Thu, 21 Sep 2000 18:05:46 -0700


Update of /cvsroot/python/distutils/distutils
In directory slayer.i.sourceforge.net:/tmp/cvs-serv30599

Modified Files:
	util.py 
Log Message:
Fix 'convert_path()' so it returns immediately under Unix -- prevents blowing
up when the pathname starts with '/', which is needed when converting
installation directories in the "install" command.

Index: util.py
===================================================================
RCS file: /cvsroot/python/distutils/distutils/util.py,v
retrieving revision 1.45
retrieving revision 1.46
diff -C2 -r1.45 -r1.46
*** util.py	2000/09/21 01:23:35	1.45
--- util.py	2000/09/22 01:05:43	1.46
***************
*** 69,81 ****
         (unless the local separator is '/', of course)."""
  
      if pathname[0] == '/':
          raise ValueError, "path '%s' cannot be absolute" % pathname
      if pathname[-1] == '/':
          raise ValueError, "path '%s' cannot end with '/'" % pathname
!     if os.sep != '/':
!         paths = string.split (pathname, '/')
!         return apply (os.path.join, paths)
!     else:
!         return pathname
  
  # convert_path ()
--- 69,81 ----
         (unless the local separator is '/', of course)."""
  
+     if os.sep == '/':
+         return pathname
      if pathname[0] == '/':
          raise ValueError, "path '%s' cannot be absolute" % pathname
      if pathname[-1] == '/':
          raise ValueError, "path '%s' cannot end with '/'" % pathname
! 
!     paths = string.split(pathname, '/')
!     return apply(os.path.join, paths)
  
  # convert_path ()