mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
Remove fallback for types.SimpleNamespace (#2049)
This commit is contained in:
parent
a13a2096ed
commit
c435341e66
@ -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)
|
||||
|
||||
@ -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(
|
||||
|
||||
@ -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):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user