Skip to content

Commit

Permalink
Fix bug in OutputCheck program that calls driver. If OutputCheck is
Browse files Browse the repository at this point in the history
installed by pip then when we run the test suite the installed version
gets used rather than the git repo version because the system import
is attempted and only if that failed would we look in the git repo
for the OuputCheck package.

Now we do it the other way round so if OutputCheck if being run from
the Git repository we use that in preference to a system installed
version.
  • Loading branch information
Dan Liew committed Mar 19, 2014
1 parent d890e92 commit 50a8ea9
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions bin/OutputCheck
@@ -1,14 +1,13 @@
#!/usr/bin/env python
import sys
import os
try:
import OutputCheck.Driver
except ImportError:
# Try to see if we are being run from inside git repo
root = os.path.dirname( os.path.dirname( os.path.abspath(__file__) ))
if os.path.exists( os.path.join(root,'OutputCheck')):
sys.path.append(root)
import OutputCheck.Driver

# Try to see if we are being run from inside git repo
root = os.path.dirname( os.path.dirname( os.path.abspath(__file__) ))
if os.path.exists( os.path.join(root,'OutputCheck')):
sys.path.insert(0, root)

import OutputCheck.Driver

if __name__ == '__main__':
sys.exit(OutputCheck.Driver.main(sys.argv))

0 comments on commit 50a8ea9

Please sign in to comment.