mirror of
https://github.com/python/cpython.git
synced 2025-12-07 17:57:56 +00:00
Look for uuencoded test files in the directory containing this module, too.
(This is necessary because when imported as test.test_rgbimg, the test directory is not on sys.path.)
This commit is contained in:
parent
bc8b2bd95e
commit
eeadc04200
1 changed files with 6 additions and 2 deletions
|
|
@ -11,8 +11,12 @@ print 'RGBimg test suite:'
|
||||||
def findfile(file):
|
def findfile(file):
|
||||||
if os.path.isabs(file): return file
|
if os.path.isabs(file): return file
|
||||||
import sys
|
import sys
|
||||||
print "__file__ =", __file__
|
path = sys.path
|
||||||
for dn in [os.path.dirname(__file__)] + sys.path:
|
try:
|
||||||
|
path = [os.path.dirname(__file__)] + path
|
||||||
|
except NameError:
|
||||||
|
pass
|
||||||
|
for dn in path:
|
||||||
fn = os.path.join(dn, file)
|
fn = os.path.join(dn, file)
|
||||||
if os.path.exists(fn): return fn
|
if os.path.exists(fn): return fn
|
||||||
return file
|
return file
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue