mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
change __dict__ to vars function
Back gunicorn/argparse_compat.py gunicorn/six.py files changes Back run_gunicorn.py file changes
This commit is contained in:
parent
3f9eace246
commit
ab444eed50
@ -100,7 +100,7 @@ class Application(BaseApplication):
|
|||||||
return cfg
|
return cfg
|
||||||
|
|
||||||
def get_config_from_module_name(self, module_name):
|
def get_config_from_module_name(self, module_name):
|
||||||
return util.import_module(module_name).__dict__
|
return vars(util.import_module(module_name))
|
||||||
|
|
||||||
def load_config_from_module_name_or_filename(self, location):
|
def load_config_from_module_name_or_filename(self, location):
|
||||||
"""
|
"""
|
||||||
@ -167,7 +167,7 @@ class Application(BaseApplication):
|
|||||||
|
|
||||||
# Lastly, update the configuration with any command line
|
# Lastly, update the configuration with any command line
|
||||||
# settings.
|
# settings.
|
||||||
for k, v in args.__dict__.items():
|
for k, v in vars(args).items():
|
||||||
if v is None:
|
if v is None:
|
||||||
continue
|
continue
|
||||||
if k == "args":
|
if k == "args":
|
||||||
|
|||||||
@ -387,7 +387,7 @@ def import_app(module):
|
|||||||
|
|
||||||
is_debug = logging.root.level == logging.DEBUG
|
is_debug = logging.root.level == logging.DEBUG
|
||||||
try:
|
try:
|
||||||
app = eval(obj, mod.__dict__)
|
app = eval(obj, vars(mod))
|
||||||
except NameError:
|
except NameError:
|
||||||
if is_debug:
|
if is_debug:
|
||||||
traceback.print_exception(*sys.exc_info())
|
traceback.print_exception(*sys.exc_info())
|
||||||
|
|||||||
@ -38,12 +38,12 @@ try:
|
|||||||
except ImportError:
|
except ImportError:
|
||||||
class SimpleNamespace(object):
|
class SimpleNamespace(object):
|
||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
self.__dict__.update(kwargs)
|
vars(self).update(kwargs)
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
keys = sorted(self.__dict__)
|
keys = sorted(vars(self))
|
||||||
items = ("{}={!r}".format(k, self.__dict__[k]) for k in keys)
|
items = ("{}={!r}".format(k, vars(self)[k]) for k in keys)
|
||||||
return "{}({})".format(type(self).__name__, ", ".join(items))
|
return "{}({})".format(type(self).__name__, ", ".join(items))
|
||||||
|
|
||||||
def __eq__(self, other):
|
def __eq__(self, other):
|
||||||
return self.__dict__ == other.__dict__
|
return vars(self) == vars(other)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user