From: Neal Norwitz Date: Tue, 13 Aug 2002 17:42:57 +0000 (+0000) Subject: SF bug #574235, convert_path fails with empty pathname X-Git-Tag: v2.3c1~4505 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b0df6a1afa585c5f4d097aeb68e41996a9fff9d7;p=python SF bug #574235, convert_path fails with empty pathname --- diff --git a/Lib/distutils/util.py b/Lib/distutils/util.py index d9c622487c..8d22415496 100644 --- a/Lib/distutils/util.py +++ b/Lib/distutils/util.py @@ -84,9 +84,11 @@ def convert_path (pathname): """ if os.sep == '/': return pathname - if pathname and pathname[0] == '/': + if not pathname: + return pathname + if pathname[0] == '/': raise ValueError, "path '%s' cannot be absolute" % pathname - if pathname and pathname[-1] == '/': + if pathname[-1] == '/': raise ValueError, "path '%s' cannot end with '/'" % pathname paths = string.split(pathname, '/')