[Python-checkins] python/dist/src/Lib/distutils util.py,1.66,1.67

akuchling@sourceforge.net akuchling@sourceforge.net
Mon, 06 May 2002 06:57:21 -0700


Update of /cvsroot/python/python/dist/src/Lib/distutils
In directory usw-pr-cvs1:/tmp/cvs-serv21764

Modified Files:
	util.py 
Log Message:
Prevent convert_path from crashing if the path is an empty string.  Bugfix candidate.

Index: util.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/distutils/util.py,v
retrieving revision 1.66
retrieving revision 1.67
diff -C2 -d -r1.66 -r1.67
*** util.py	31 Jan 2002 18:55:48 -0000	1.66
--- util.py	6 May 2002 13:57:19 -0000	1.67
***************
*** 85,91 ****
      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
  
--- 85,91 ----
      if os.sep == '/':
          return pathname
!     if pathname and pathname[0] == '/':
          raise ValueError, "path '%s' cannot be absolute" % pathname
!     if pathname and pathname[-1] == '/':
          raise ValueError, "path '%s' cannot end with '/'" % pathname