Timeout was marked deprecated along with TimeoutError by mistake
https://github.com/eventlet/eventlet/issues/378
This commit is contained in:
parent
0f81f03bf6
commit
a41a74902e
@ -73,8 +73,10 @@ Autoupgrade: fgrep -rl '{old}' . |xargs -t sed --in-place='' -e 's/{old}/{new}/'
|
||||
def wrapper(base):
|
||||
klass = None
|
||||
if inspect.isclass(base):
|
||||
klass = base
|
||||
base = klass.__init__
|
||||
class klass(base):
|
||||
pass
|
||||
klass.__name__ = base.__name__
|
||||
klass.__module__ = base.__module__
|
||||
|
||||
@functools.wraps(base)
|
||||
def wrapped(*a, **kw):
|
||||
|
@ -177,3 +177,10 @@ def test_wrap_is_timeout():
|
||||
|
||||
obj = eventlet.wrap_is_timeout(A)()
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user