Skip to content

Commit

Permalink
Improved 'uwsgi' proxy module.
Browse files Browse the repository at this point in the history
  • Loading branch information
idlesign committed Dec 7, 2017
1 parent 60f6b3f commit 999a713
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions uwsgiconf/uwsgi.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
from __future__ import absolute_import

from sys import modules
from os import environ as __env

from .settings import ENV_FORCE_STUB
from .exceptions import UwsgiconfException as __DummyException


if False: # pragma: nocover
# Give IDEs a chance load stub symbols.
from .uwsgi_stub import *


try: # pragma: nocover
if __env.get(ENV_FORCE_STUB, False):
raise __DummyException('`UWSGI_FORCE_STUB` is found in env.')
Expand All @@ -15,7 +21,10 @@

####################################################################

from uwsgi import *
import uwsgi

# The following allows proper dynamic attributes (e.g. ``env``) addressing.
modules[__name__] = uwsgi

except (ImportError, __DummyException):

Expand All @@ -24,4 +33,6 @@

####################################################################

from .uwsgi_stub import *
import uwsgi_stub

modules[__name__] = uwsgi_stub

0 comments on commit 999a713

Please sign in to comment.