projects
/
tahoe-lafs
/
tahoe-lafs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4c06ea4
)
misc/build_helpers/run_trial.py: allow the module argument to specify a leaf module...
author
david-sarah
<david-sarah@jacaranda.org>
Sun, 21 Nov 2010 23:39:57 +0000
(15:39 -0800)
committer
david-sarah
<david-sarah@jacaranda.org>
Sun, 21 Nov 2010 23:39:57 +0000
(15:39 -0800)
misc/build_helpers/run_trial.py
patch
|
blob
|
history
diff --git
a/misc/build_helpers/run_trial.py
b/misc/build_helpers/run_trial.py
index d448a00f4bb44c93de0402f392500c978f424727..29fce952ea5e9f8b716687ec3a9a60322dd2dc9d 100644
(file)
--- a/
misc/build_helpers/run_trial.py
+++ b/
misc/build_helpers/run_trial.py
@@
-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'):