Prefer `import` to `__import__` by zwimer · Pull Request #82 · gitpython-developers/gitdb
This repository was archived by the owner on Jul 26, 2026. It is now read-only.
Prefer
Merged
Byron merged 2 commits into gitpython-developers:master from zwimer:prefer-standard-import Nov 23, 2022
Merged
Prefer
Copy link Copy Markdown
Contributor
Copy link Copy Markdown
Member
Byron
merged commit
Repository navigation
Prefer import to __import__ - #82
Merged
Byron merged 2 commits into gitpython-developers:master from zwimer:prefer-standard-import Nov 23, 2022
Merged
Prefer import to __import__ #82
Byron merged 2 commits into
gitpython-developers:master from
zwimer:prefer-standard-import
Conversation
zwimer commented Nov 23, 2022
Copy link Copy Markdown
Contributor
What
In __init__.py there is a loop that invokes __import__ here:
Line 13 in 3415e08
| def _init_externals (): |
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()
Prefer import to __import__
c3ab5d7
Add del smmap to match previous behavior
1edc7d2
zwimer
mentioned this pull request
Nov 23, 2022
Refactor installation and plugin management system
binsync/binsync#219
Closed
Byron commented Nov 23, 2022
Copy link Copy Markdown
Member
|
Thanks a lot, this change is much appreciated. It's clear that this kind of |
43de984
into
gitpython-developers : master
Nov 23, 2022
Sign up for free
to subscribe to this conversation on GitHub .
Already have an account?
Sign in .