Since the loop only has one item this PR convert refactors it to use the standard import.
Why
Some tooling only works with modules to be imported via import as the packages names are resolve-able without executing code, which __import__ prevents.
Possible Changes
If it is desired to have smmap added into globals() of __init__.py; I can remove the del smmap line. Right now it is there because __import__, which import is replacing, does not add smmap to globals()
Thanks a lot, this change is much appreciated. It's clear that this kind of __import__ logic isn't very useful here anymore, after all it's just a single module to import.
What
In
__init__.py
there is a loop that invokes__import__
here: https://github.com/gitpython-developers/gitdb/blob/3415e08bd9590d489f1071815863bfdde3083fb3/gitdb/__init__.py#L13Since the loop only has one item this PR convert refactors it to use the standard
import
.Why
Some tooling only works with modules to be imported via
import
as the packages names are resolve-able without executing code, which__import__
prevents.Possible Changes
If it is desired to have
smmap
added intoglobals()
of__init__.py
; I can remove thedel smmap
line. Right now it is there because__import__
, whichimport
is replacing, does not addsmmap
toglobals()