From 52672a64cc0cab4ea14a4a756fce850eb03315e3 Mon Sep 17 00:00:00 2001 From: Jim Rollenhagen Date: Thu, 26 Sep 2019 09:56:42 -0400 Subject: Retire github mirror, repo moved to opendev --- migrate/versioning/util/importpath.py | 30 ------------------------------ 1 file changed, 30 deletions(-) delete mode 100644 migrate/versioning/util/importpath.py (limited to 'migrate/versioning/util/importpath.py') diff --git a/migrate/versioning/util/importpath.py b/migrate/versioning/util/importpath.py deleted file mode 100644 index 529be89..0000000 --- a/migrate/versioning/util/importpath.py +++ /dev/null @@ -1,30 +0,0 @@ -import os -import sys - -PY33 = sys.version_info >= (3, 3) - -if PY33: - from importlib import machinery -else: - from six.moves import reload_module as reload - - -def import_path(fullpath): - """ Import a file with full path specification. Allows one to - import from anywhere, something __import__ does not do. - """ - if PY33: - name = os.path.splitext(os.path.basename(fullpath))[0] - return machinery.SourceFileLoader( - name, fullpath).load_module(name) - else: - # http://zephyrfalcon.org/weblog/arch_d7_2002_08_31.html - path, filename = os.path.split(fullpath) - filename, ext = os.path.splitext(filename) - sys.path.append(path) - try: - module = __import__(filename) - reload(module) # Might be out of date during tests - return module - finally: - del sys.path[-1] -- cgit v1.2.1