Commit f1b0009a authored by Guido van Rossum's avatar Guido van Rossum

Fix path search for test data file so it works under more circumstances.

parent 88d8beec
...@@ -155,7 +155,12 @@ def get_qualified_path(name): ...@@ -155,7 +155,12 @@ def get_qualified_path(name):
""" return a more qualified path to name""" """ return a more qualified path to name"""
import sys import sys
import os import os
for dir in sys.path: path = sys.path
try:
path = [os.path.dirname(__file__)] + path
except NameError:
pass
for dir in path:
fullname = os.path.join(dir, name) fullname = os.path.join(dir, name)
if os.path.exists(fullname): if os.path.exists(fullname):
return fullname return fullname
......
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