Commit 12f21ae0 authored by Tim Peters's avatar Tim Peters

Patch from Gordon McMillan.

updatecache():  When using imputil, sys.path may contain things other than
strings.  Ignore such things instead of blowing up.
Hard to say whether this is a bugfix or a feature ...
parent 4324aa35
......@@ -69,10 +69,17 @@ def updatecache(filename):
try:
stat = os.stat(fullname)
except os.error, msg:
# Try looking through the module search path
# Try looking through the module search path.
basename = os.path.split(filename)[1]
for dirname in sys.path:
# When using imputil, sys.path may contain things other than
# strings; ignore them when it happens.
try:
fullname = os.path.join(dirname, basename)
except (TypeError, AttributeError):
# Not sufficiently string-like to do anything useful with.
pass
else:
try:
stat = os.stat(fullname)
break
......
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