mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
the right way to dynamically specify a module for import
This commit is contained in:
parent
ccb47b4993
commit
2ac910adcf
@ -54,7 +54,7 @@ def load_modules():
|
||||
if name.endswith(".py") and not name.startswith('.'):
|
||||
cfg.log.info("importing modules/%s" % name)
|
||||
try:
|
||||
exec("import modules.%s" % (name[:-3]))
|
||||
__import__("modules.%s" % (name[:-3]))
|
||||
except ImportError, e:
|
||||
cfg.log.error(_("Couldn't import modules/%s: %s") % (name, e))
|
||||
else:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user