summaryrefslogtreecommitdiff
path: root/source4/scripting/python
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2010-12-10 03:03:18 +0100
committerJelmer Vernooij <jelmer@samba.org>2010-12-10 03:49:03 +0100
commit10441ed83d701d6db64c3a933cf09957355e1db2 (patch)
treedbe01ab4dc39e5da4769e0578cb00158154522ee /source4/scripting/python
parent636d8cfb423bbdf271df25efbc13c91420ebefe8 (diff)
downloadsamba-10441ed83d701d6db64c3a933cf09957355e1db2.tar.gz
samba-10441ed83d701d6db64c3a933cf09957355e1db2.tar.bz2
samba-10441ed83d701d6db64c3a933cf09957355e1db2.zip
subunitrun: Use unittest.TestProgram if subunit.TestProgram is not
available. Autobuild-User: Jelmer Vernooij <jelmer@samba.org> Autobuild-Date: Fri Dec 10 03:49:03 CET 2010 on sn-devel-104
Diffstat (limited to 'source4/scripting/python')
-rw-r--r--source4/scripting/python/samba/__init__.py17
1 files changed, 1 insertions, 16 deletions
diff --git a/source4/scripting/python/samba/__init__.py b/source4/scripting/python/samba/__init__.py
index 6fcac16691..5294368b6d 100644
--- a/source4/scripting/python/samba/__init__.py
+++ b/source4/scripting/python/samba/__init__.py
@@ -318,27 +318,12 @@ def import_bundled_package(modulename, location):
sys.path.insert(0,
os.path.join(os.path.dirname(__file__),
"../../../../lib", location))
- __import__(modulename)
+ sys.modules[modulename] = __import__(modulename)
else:
sys.modules[modulename] = __import__(
"samba.external.%s" % modulename, fromlist=["samba.external"])
-def force_bundled_package(packagename, location):
- """Forcibly use the bundled package.
-
- This will first unload the system module and then load the bundled one.
-
- :param packagename: The package name
- :param location: Location to add to sys.path (can be relative to
- ${srcdir}/lib)
- """
- for m in sys.modules.keys():
- if m.startswith("%s." % packagename):
- del sys.modules[m]
- import_bundled_package(packagename, location)
-
-
def ensure_external_module(modulename, location):
"""Add a location to sys.path if an external dependency can't be found.