test_runner.py: another try at calculating the rootdir correctly for test-from-egg and test-from-prefixdir.

This commit is contained in:
david-sarah 2010-08-08 08:43:07 -07:00
parent 39fa9a81d1
commit dc53d4f5ef

View File

@ -17,14 +17,10 @@ timeout = 240
srcfile = allmydata.__file__
srcdir = os.path.dirname(os.path.dirname(os.path.realpath(srcfile)))
if os.path.normcase(srcdir).endswith('.egg'):
srcdir = os.path.dirname(srcdir)
elif os.path.normcase(os.path.basename(srcdir)) == 'site-packages':
if os.path.normcase(os.path.basename(srcdir)) == 'site-packages':
srcdir = os.path.dirname(srcdir)
if re.search(r'python.+\..+', os.path.normcase(os.path.basename(srcdir))):
srcdir = os.path.dirname(srcdir)
if os.path.normcase(os.path.basename(srcdir)) == 'lib':
srcdir = os.path.dirname(srcdir)
rootdir = os.path.dirname(srcdir)