Timeout was marked deprecated along with TimeoutError by mistake
https://github.com/eventlet/eventlet/issues/378
This commit is contained in:
@@ -73,8 +73,10 @@ Autoupgrade: fgrep -rl '{old}' . |xargs -t sed --in-place='' -e 's/{old}/{new}/'
|
|||||||
def wrapper(base):
|
def wrapper(base):
|
||||||
klass = None
|
klass = None
|
||||||
if inspect.isclass(base):
|
if inspect.isclass(base):
|
||||||
klass = base
|
class klass(base):
|
||||||
base = klass.__init__
|
pass
|
||||||
|
klass.__name__ = base.__name__
|
||||||
|
klass.__module__ = base.__module__
|
||||||
|
|
||||||
@functools.wraps(base)
|
@functools.wraps(base)
|
||||||
def wrapped(*a, **kw):
|
def wrapped(*a, **kw):
|
||||||
|
@@ -177,3 +177,10 @@ def test_wrap_is_timeout():
|
|||||||
|
|
||||||
obj = eventlet.wrap_is_timeout(A)()
|
obj = eventlet.wrap_is_timeout(A)()
|
||||||
tests.check_is_timeout(obj)
|
tests.check_is_timeout(obj)
|
||||||
|
|
||||||
|
|
||||||
|
def test_timeouterror_deprecated():
|
||||||
|
# https://github.com/eventlet/eventlet/issues/378
|
||||||
|
code = '''import eventlet; eventlet.Timeout(1).cancel(); print('pass')'''
|
||||||
|
args = ['-Werror:eventlet.Timeout:DeprecationWarning', '-c', code]
|
||||||
|
tests.run_python(path=None, args=args, expect_pass=True)
|
||||||
|
Reference in New Issue
Block a user