diff options
author | Christoph Reiter <reiter.christoph@gmail.com> | 2020-11-06 15:48:56 +0100 |
---|---|---|
committer | Christoph Reiter <reiter.christoph@gmail.com> | 2020-11-07 09:09:19 +0100 |
commit | 030aa5f5db380efa73802cb92cb92d156c3dc860 (patch) | |
tree | a0b9c6ad75153da4202ab46c8e23cd3b960683ac /tests | |
parent | b60e4030846ee85835c16dcbd1899f2155d90587 (diff) | |
download | gobject-introspection-030aa5f5db380efa73802cb92cb92d156c3dc860.tar.gz |
tests: Remove metapath hack to import when uninstalled
This was required for Python 2 where Python didn't import our built modules
in the build dir because there is no __init__.py. In Python 3 this just works.
Tested with setup.py/pytest/meson
Diffstat (limited to 'tests')
-rw-r--r-- | tests/__init__.py | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/tests/__init__.py b/tests/__init__.py index 44068d2c..b96f8a8d 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -5,29 +5,6 @@ import signal import subprocess import atexit import warnings -import imp - - -class GIImport: - def find_module(self, fullname, path=None): - if fullname in ('gi._gi', 'gi._gi_cairo'): - return self - return None - - def load_module(self, name): - if name in sys.modules: - return sys.modules[name] - fp, pathname, description = imp.find_module(name.split('.')[-1]) - try: - module = imp.load_module(name, fp, pathname, description) - finally: - if fp: - fp.close() - sys.modules[name] = module - return module - - -sys.meta_path.insert(0, GIImport()) def init_test_environ(): |