Fixed a regression in the changes made to all_from_module that caused evform to fail.

This commit is contained in:
Griatch 2016-02-14 08:46:55 +01:00
parent 83e24678f5
commit 323a353ec3

View file

@ -975,8 +975,9 @@ def all_from_module(module):
mod = mod_import(module)
if not mod:
return {}
# make sure to only return variables actually defined in this module (not imports)
members = getmembers(mod, predicate=lambda obj: getmodule(obj) == mod)
# make sure to only return variables actually defined in this
# 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 mod.__dict__.items()
# if not (key.startswith("_") or ismodule(val)))