summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2010-12-09 22:48:16 +0100
committerJelmer Vernooij <jelmer@samba.org>2010-12-10 03:04:06 +0100
commitb1daa502935026854758dc47868866b022c53128 (patch)
tree5a64f72a221f230a7997fc7579624a4d2504ac6c
parent8f4c064b49f01e7d53d5610da6b6574615d9f188 (diff)
downloadsamba-b1daa502935026854758dc47868866b022c53128.tar.gz
samba-b1daa502935026854758dc47868866b022c53128.tar.bz2
samba-b1daa502935026854758dc47868866b022c53128.zip
subunitrun: Remove global subunit module when reimporting from a
different location.
-rwxr-xr-xsource4/scripting/bin/subunitrun7
1 files changed, 6 insertions, 1 deletions
diff --git a/source4/scripting/bin/subunitrun b/source4/scripting/bin/subunitrun
index 87519d5661..4078562ab4 100755
--- a/source4/scripting/bin/subunitrun
+++ b/source4/scripting/bin/subunitrun
@@ -26,7 +26,12 @@ import optparse
import samba
samba.ensure_external_module("testtools", "testtools")
samba.ensure_external_module("subunit", "subunit/python")
-from subunit.run import SubunitTestRunner, TestProgram
+try:
+ from subunit.run import SubunitTestRunner, TestProgram
+except ImportError:
+ del sys.modules["subunit"]
+ samba.import_bundled_package("subunit", "subunit/python")
+ from subunit.run import SubunitTestRunner, TestProgram
import samba.getopt as options
import samba.tests