Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid repeated initialization of the shim module
When the shim module tries to reload itself, it repeats the loop of trying all the sitepackages directories, and because importlib.reload() is noop when called recursively, it ends up raising ImportError that is visible to the user. Even though execution returns to the original loop and the system RPM module is loaded successfully, the error message produced is very confusing. Improve that by avoiding repeated initialization of the shim module. Also make sure that importlib.reload(), when loading the shim module for the second time, throws a specific exception that doesn't trigger any log message, to make things even less confusing. Signed-off-by: Nikola Forró <[email protected]>
- Loading branch information