Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check loaded module names before importing a new one from a file (#119)
Fixes a bug that prevents in-file benchmark execution due to a type mismatch when calling runner.run() with __file__ as argument (or just the name). The reason was that on encountering a file name, the Python module that the file pointed to was imported under its absolute path name regardless of whether it was already present in sys.modules (in this case, it was, because it is also __main__). Adds a check in `import_file_as_module` whether a module already exists in sys.modules for the given file name, in which case that module is returned.
- Loading branch information