Fixed a regression in the changes made to all_from_module that caused evform to fail.
This commit is contained in:
parent
83e24678f5
commit
323a353ec3
1 changed files with 3 additions and 2 deletions
|
|
@ -975,8 +975,9 @@ def all_from_module(module):
|
||||||
mod = mod_import(module)
|
mod = mod_import(module)
|
||||||
if not mod:
|
if not mod:
|
||||||
return {}
|
return {}
|
||||||
# make sure to only return variables actually defined in this module (not imports)
|
# make sure to only return variables actually defined in this
|
||||||
members = getmembers(mod, predicate=lambda obj: getmodule(obj) == mod)
|
# module if available (try to avoid not imports)
|
||||||
|
members = getmembers(mod, predicate=lambda obj: getmodule(obj) in (mod, None))
|
||||||
return dict((key, val) for key, val in members if not key.startswith("_"))
|
return dict((key, val) for key, val in members if not key.startswith("_"))
|
||||||
#return dict((key, val) for key, val in mod.__dict__.items()
|
#return dict((key, val) for key, val in mod.__dict__.items()
|
||||||
# if not (key.startswith("_") or ismodule(val)))
|
# if not (key.startswith("_") or ismodule(val)))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue