Remove fallback for types.SimpleNamespace (#2049)

This commit is contained in:
Masashi SHIBATA 2019-05-28 22:05:51 +09:00 committed by Berker Peksag
parent a13a2096ed
commit c435341e66
3 changed files with 2 additions and 18 deletions

View File

@ -48,18 +48,3 @@ def requires_mac_ver(*min_version):
wrapper.min_version = min_version
return wrapper
return decorator
try:
from types import SimpleNamespace # pylint: disable=unused-import
except ImportError:
class SimpleNamespace(object):
def __init__(self, **kwargs):
vars(self).update(kwargs)
def __repr__(self):
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 vars(self) == vars(other)

View File

@ -1,10 +1,9 @@
import datetime
from types import SimpleNamespace
from gunicorn.config import Config
from gunicorn.glogging import Logger
from support import SimpleNamespace
def test_atoms_defaults():
response = SimpleNamespace(

View File

@ -5,10 +5,10 @@ import shutil
import socket
import tempfile
from datetime import timedelta
from types import SimpleNamespace
from gunicorn.config import Config
from gunicorn.instrument.statsd import Statsd
from support import SimpleNamespace
class StatsdTestException(Exception):