Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions reframe/utility/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,13 @@ def import_module_from_file(filename):
# module to import is outside the top-level package
return _do_import_module_from_file(filename, module_name)

# Extract module name if `filename` is under `site-packages/` or the
# Debian specific `dist-packages/`
site_packages = re.compile(r'.*(site|dist)-packages/(?P<rel_filename>.+)')
match = site_packages.search(filename)
if match:
module_name = _get_module_name(match['rel_filename'])

return importlib.import_module(module_name)


Expand Down