Commit f40275a1 authored by Andrew M. Kuchling's avatar Andrew M. Kuchling

Prevent convert_path from crashing if the path is an empty string. Bugfix candidate.

parent 33b72ce7
......@@ -84,9 +84,9 @@ def convert_path (pathname):
"""
if os.sep == '/':
return pathname
if pathname[0] == '/':
if pathname and pathname[0] == '/':
raise ValueError, "path '%s' cannot be absolute" % pathname
if pathname[-1] == '/':
if pathname and pathname[-1] == '/':
raise ValueError, "path '%s' cannot end with '/'" % pathname
paths = string.split(pathname, '/')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment