mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-02-01 08:48:01 +00:00
misc/build_helpers/run_trial.py: allow the module argument to specify a leaf module rather than a directory. This fixes false positive wrong-source errors in the test-from-prefixdir step when we test only allmydata.test.test_runner.
This commit is contained in:
parent
4c06ea4a72
commit
41e96b3e5a
@ -52,7 +52,14 @@ if modulename is None:
|
||||
__import__(modulename)
|
||||
srcfile = sys.modules[modulename].__file__
|
||||
srcdir = os.path.dirname(os.path.realpath(srcfile))
|
||||
for i in modulename.split('.'):
|
||||
|
||||
components = modulename.split('.')
|
||||
leaf = os.path.normcase(components[-1])
|
||||
if os.path.normcase(os.path.basename(srcfile)) in (leaf + '.py', leaf + '.pyc'):
|
||||
# strip the leaf module name
|
||||
components = components[:-1]
|
||||
|
||||
for i in components:
|
||||
srcdir = os.path.dirname(srcdir)
|
||||
|
||||
if os.path.normcase(srcdir).endswith('.egg'):
|
||||
|
Loading…
x
Reference in New Issue
Block a user