diff --git a/gunicorn/util.py b/gunicorn/util.py index 37e586a8..3ec54af0 100644 --- a/gunicorn/util.py +++ b/gunicorn/util.py @@ -369,8 +369,7 @@ def import_app(module): if module.endswith(".py") and os.path.exists(module): msg = "Failed to find application, did you mean '%s:%s'?" raise ImportError(msg % (module.rsplit(".", 1)[0], obj)) - else: - raise + raise mod = sys.modules[module] diff --git a/gunicorn/workers/geventlet.py b/gunicorn/workers/geventlet.py index 91d2f333..20f29734 100644 --- a/gunicorn/workers/geventlet.py +++ b/gunicorn/workers/geventlet.py @@ -92,8 +92,7 @@ class EventletWorker(AsyncWorker): def is_already_handled(self, respiter): if respiter == EVENTLET_ALREADY_HANDLED: raise StopIteration() - else: - return super().is_already_handled(respiter) + return super().is_already_handled(respiter) def init_process(self): super().init_process()