Skip to content

Commit

Permalink
Fix noop for python 3.4
Browse files Browse the repository at this point in the history
  • Loading branch information
emlove committed Apr 27, 2017
1 parent 0f51eca commit 6407eff
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 22 deletions.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ Changes

- Add DummyCookieJar helper. #1830

- Fix assertion errors in Python 3.4 from noop helper. #1847


2.0.7 (2017-04-12)
------------------
Expand Down
32 changes: 10 additions & 22 deletions aiohttp/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,34 +53,22 @@
'?', '=', '{', '}', ' ', chr(9)}
TOKEN = CHAR ^ CTL ^ SEPARATORS

coroutines = asyncio.coroutines
old_debug = coroutines._DEBUG
coroutines._DEBUG = False

if sys.version_info < (3, 5): # pragma: no cover
noop = tuple

coroutines = asyncio.coroutines
old_debug = coroutines._DEBUG
coroutines._DEBUG = False
@asyncio.coroutine
def noop(*args, **kwargs):
return

@asyncio.coroutine
def deprecated_noop(message):
warnings.warn(message, DeprecationWarning, stacklevel=3)

coroutines._DEBUG = old_debug
@asyncio.coroutine
def deprecated_noop(message):
warnings.warn(message, DeprecationWarning, stacklevel=3)

else:
coroutines = asyncio.coroutines
old_debug = coroutines._DEBUG
coroutines._DEBUG = False

@asyncio.coroutine
def noop(*args, **kwargs):
return

@asyncio.coroutine
def deprecated_noop(message):
warnings.warn(message, DeprecationWarning, stacklevel=3)

coroutines._DEBUG = old_debug
coroutines._DEBUG = old_debug


class BasicAuth(namedtuple('BasicAuth', ['login', 'password', 'encoding'])):
Expand Down

0 comments on commit 6407eff

Please sign in to comment.