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 26, 2017
1 parent a17d55e commit 66b73ba
Showing 1 changed file with 10 additions and 22 deletions.
32 changes: 10 additions & 22 deletions aiohttp/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,34 +52,22 @@
'?', '=', '{', '}', ' ', chr(9)}
TOKEN = CHAR ^ CTL ^ SEPARATORS

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

if sys.version_info < (3, 5):
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 66b73ba

Please sign in to comment.