mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
replace shim wrap_method with staticmethod
This commit is contained in:
parent
c171c15c63
commit
bff593d9e4
@ -31,12 +31,6 @@ KNOWN_SETTINGS = []
|
|||||||
PLATFORM = sys.platform
|
PLATFORM = sys.platform
|
||||||
|
|
||||||
|
|
||||||
def wrap_method(func):
|
|
||||||
def _wrapped(instance, *args, **kwargs):
|
|
||||||
return func(*args, **kwargs)
|
|
||||||
return _wrapped
|
|
||||||
|
|
||||||
|
|
||||||
def make_settings(ignore=None):
|
def make_settings(ignore=None):
|
||||||
settings = {}
|
settings = {}
|
||||||
ignore = ignore or ()
|
ignore = ignore or ()
|
||||||
@ -246,7 +240,7 @@ class SettingMeta(type):
|
|||||||
return super_new(cls, name, bases, attrs)
|
return super_new(cls, name, bases, attrs)
|
||||||
|
|
||||||
attrs["order"] = len(KNOWN_SETTINGS)
|
attrs["order"] = len(KNOWN_SETTINGS)
|
||||||
attrs["validator"] = wrap_method(attrs["validator"])
|
attrs["validator"] = staticmethod(attrs["validator"])
|
||||||
|
|
||||||
new_class = super_new(cls, name, bases, attrs)
|
new_class = super_new(cls, name, bases, attrs)
|
||||||
new_class.fmt_desc(attrs.get("desc", ""))
|
new_class.fmt_desc(attrs.get("desc", ""))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user