Commit 4ed2b4ff authored by Lee McCuller's avatar Lee McCuller
Browse files

fix for import to foreward arguments more natively

parent 59cdc2a4
......@@ -147,7 +147,8 @@ class GuardSystem(object):
# except AttributeError:
# pass
def _import(self, name, globals=None, locals=None, fromlist=None, level=0):
#def _import(self, name, globals=None, locals=None, fromlist=None, level=0):
def _import(self, *args, **kwargs):
# custom import function that uses the builtin import function to import
# modules, appending "usercode" modules in usercode attribute. it also
# reloads modules in the guardpath if they've already been loaded
......@@ -159,8 +160,10 @@ class GuardSystem(object):
# FIXME: we need to use the builtin import because it appears
# to be the only thing that handles both submodule import and
# the "from . import ." form
module = _builtin__import__(name, globals, locals, fromlist, level=level)
module = _builtin__import__(*args, **kwargs)
return self._import_guardchecks(module, *args, **kwargs)
def _import_guardchecks(self, module, name, globals=None, locals=None, fromlist=None, level=0):
# ignore "built-in" modules (i.e. without __file__)
if not hasattr(module, '__file__'):
return module
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment