mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
fix issue #104.
This commit is contained in:
parent
658296f717
commit
2ad2a61f0c
@ -206,7 +206,16 @@ def import_app(module):
|
|||||||
module, obj = module, "application"
|
module, obj = module, "application"
|
||||||
else:
|
else:
|
||||||
module, obj = parts[0], parts[1]
|
module, obj = parts[0], parts[1]
|
||||||
__import__(module)
|
|
||||||
|
try:
|
||||||
|
__import__(module)
|
||||||
|
except ImportError:
|
||||||
|
if module.endswith(".py") and os.path.exists(module):
|
||||||
|
raise ImportError("Failed to find application, did "
|
||||||
|
"you mean '%s:%s'?" % (module.rsplit(".",1)[0], obj))
|
||||||
|
else:
|
||||||
|
raise
|
||||||
|
|
||||||
mod = sys.modules[module]
|
mod = sys.modules[module]
|
||||||
app = eval(obj, mod.__dict__)
|
app = eval(obj, mod.__dict__)
|
||||||
if app is None:
|
if app is None:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user