Permalink
Browse files

change __dict__ to vars function

Back gunicorn/argparse_compat.py gunicorn/six.py files changes

Back run_gunicorn.py file changes
  • Loading branch information...
1 parent 3f9eace commit ab444eed50f34df33755f4e778825de8d1bf9668 @saeedghx68 saeedghx68 committed with berkerpeksag Jan 8, 2017
Showing with 7 additions and 7 deletions.
  1. +2 −2 gunicorn/app/base.py
  2. +1 −1 gunicorn/util.py
  3. +4 −4 tests/support.py
@@ -100,7 +100,7 @@ def get_config_from_filename(self, filename):
return cfg
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):
"""
@@ -167,7 +167,7 @@ def load_config(self):
# Lastly, update the configuration with any command line
# settings.
- for k, v in args.__dict__.items():
+ for k, v in vars(args).items():
if v is None:
continue
if k == "args":
View
@@ -387,7 +387,7 @@ def import_app(module):
is_debug = logging.root.level == logging.DEBUG
try:
- app = eval(obj, mod.__dict__)
+ app = eval(obj, vars(mod))
except NameError:
if is_debug:
traceback.print_exception(*sys.exc_info())
View
@@ -38,12 +38,12 @@ def wrapper(*args, **kw):
except ImportError:
class SimpleNamespace(object):
def __init__(self, **kwargs):
- self.__dict__.update(kwargs)
+ vars(self).update(kwargs)
def __repr__(self):
- keys = sorted(self.__dict__)
- items = ("{}={!r}".format(k, self.__dict__[k]) for k in keys)
+ keys = sorted(vars(self))
+ items = ("{}={!r}".format(k, vars(self)[k]) for k in keys)
return "{}({})".format(type(self).__name__, ", ".join(items))
def __eq__(self, other):
- return self.__dict__ == other.__dict__
+ return vars(self) == vars(other)

0 comments on commit ab444ee

Please sign in to comment.