Timeout was marked deprecated along with TimeoutError by mistake

https://github.com/eventlet/eventlet/issues/378
This commit is contained in:
Sergey Shepelev 2017-01-17 21:47:53 +05:00
parent 0f81f03bf6
commit a41a74902e
2 changed files with 11 additions and 2 deletions

View File

@ -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):

View File

@ -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)