fixed problem with custom import and upgraded jquery.js
This commit is contained in:
@@ -41,12 +41,15 @@ class CustomImportException(ImportError):
|
||||
|
||||
def custom_importer(name, globals=None, locals=None, fromlist=None, level=-1):
|
||||
"""
|
||||
web2py's custom importer. It behaves like the standard Python importer but
|
||||
web2py's custom importer. It behaves like the standard Python importer but
|
||||
it tries to transform import statements as something like
|
||||
"import applications.app_name.modules.x".
|
||||
If the import fails, it falls back on naive_importer
|
||||
"""
|
||||
|
||||
if isinstance(name, unicode):
|
||||
name = name.encode('utf8')
|
||||
|
||||
globals = globals or {}
|
||||
locals = locals or {}
|
||||
fromlist = fromlist or []
|
||||
@@ -77,7 +80,7 @@ def custom_importer(name, globals=None, locals=None, fromlist=None, level=-1):
|
||||
if not fromlist:
|
||||
# import like "import x" or "import x.y"
|
||||
result = None
|
||||
for itemname in name.split("."):
|
||||
for itemname in name.split("."):
|
||||
new_mod = base_importer(
|
||||
modules_prefix, globals, locals, [itemname], level)
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user