Skip to content
Snippets Groups Projects
Commit 971ab377 authored by Dr. Felix Tobias Schindler's avatar Dr. Felix Tobias Schindler
Browse files

[python] update docs

parent e106dc10
No related branches found
No related tags found
1 merge request!20Update bindings
...@@ -31,10 +31,9 @@ def guarded_import(globs, base_name, mod_name): ...@@ -31,10 +31,9 @@ def guarded_import(globs, base_name, mod_name):
names = mod.__dict__["__all__"] names = mod.__dict__["__all__"]
else: else:
names = [x for x in mod.__dict__ if not x.startswith("_")] names = [x for x in mod.__dict__ if not x.startswith("_")]
# check the rest for duplicity # check for duplicity
for nm in names: for nm in names:
if nm in globs: if nm in globs:
raise ImportError( raise ImportError(f'{base_name}: name \'{nm}\' already exists (when importing from \'{mod_name}\'!)')
f'{base_name}: not overwriting existing name \'{nm}\' when importing from \'{mod_name}\'!' ) # and import
# and finally import
globs.update({k: getattr(mod, k) for k in names}) globs.update({k: getattr(mod, k) for k in names})
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment