From: Andrew Bartlett Date: Tue, 18 Aug 2020 09:38:57 +0000 (+1200) Subject: python: Remove remaining references to third_party python libs X-Git-Tag: talloc-2.3.2~758 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4dbe8d11316891f7275a7a37e04e11abb1b3706d;p=thirdparty%2Fsamba.git python: Remove remaining references to third_party python libs For now at least we do not have any in third_party. Signed-off-by: Andrew Bartlett Reviewed-by: David Mulder Autobuild-User(master): Andrew Bartlett Autobuild-Date(master): Fri Aug 21 00:12:52 UTC 2020 on sn-devel-184 --- diff --git a/python/samba/__init__.py b/python/samba/__init__.py index 360918c49ad..0341cb36dfe 100644 --- a/python/samba/__init__.py +++ b/python/samba/__init__.py @@ -322,46 +322,6 @@ def valid_netbios_name(name): return True -def import_bundled_package(modulename, location, source_tree_container, - namespace): - """Import the bundled version of a package. - - :note: This should only be called if the system version of the package - is not adequate. - - :param modulename: Module name to import - :param location: Location to add to sys.path (can be relative to - ${srcdir}/${source_tree_container}) - :param source_tree_container: Directory under source root that - contains the bundled third party modules. - :param namespace: Namespace to import module from, when not in source tree - """ - if in_source_tree(): - extra_path = os.path.join(source_tree_topdir(), source_tree_container, - location) - if extra_path not in sys.path: - sys.path.insert(0, extra_path) - sys.modules[modulename] = __import__(modulename) - else: - sys.modules[modulename] = __import__( - "%s.%s" % (namespace, modulename), fromlist=[namespace]) - - -def ensure_third_party_module(modulename, location): - """Add a location to sys.path if a third party dependency can't be found. - - :param modulename: Module name to import - :param location: Location to add to sys.path (can be relative to - ${srcdir}/third_party) - """ - try: - __import__(modulename) - except ImportError: - import_bundled_package(modulename, location, - source_tree_container="third_party", - namespace="samba.third_party") - - def dn_from_dns_name(dnsdomain): """return a DN from a DNS name domain/forest root""" return "DC=" + ",DC=".join(dnsdomain.split(".")) diff --git a/python/samba/subunit/__init__.py b/python/samba/subunit/__init__.py index ca5511f899e..fef06ffa1cd 100644 --- a/python/samba/subunit/__init__.py +++ b/python/samba/subunit/__init__.py @@ -19,7 +19,6 @@ import samba -samba.ensure_third_party_module("iso8601", "pyiso8601") import iso8601 import unittest diff --git a/script/show_test_time b/script/show_test_time index fae7b814f49..5a84f19787c 100755 --- a/script/show_test_time +++ b/script/show_test_time @@ -10,8 +10,6 @@ parser.add_option("--limit", dest="limit", type=int, help="Limit to this number of output entries.", default=0) (opts, args) = parser.parse_args() -third_party_path = os.path.join(os.path.dirname(sys.argv[0]), "..", "lib") - durations = {} cmd = "subunit-1to2 | subunit-ls --times --no-passthrough"