mirror of
https://github.com/python/cpython
synced 2024-07-19 19:54:39 +00:00
Fix path search for test data file so it works under more circumstances.
This commit is contained in:
parent
88d8beec0a
commit
f1b0009a78
|
@ -155,7 +155,12 @@ def get_qualified_path(name):
|
|||
""" return a more qualified path to name"""
|
||||
import sys
|
||||
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)
|
||||
if os.path.exists(fullname):
|
||||
return fullname
|
||||
|
|
Loading…
Reference in a new issue