bpo-29617: Remove Python 3.3 support from asyncio (GH-232)

This commit is contained in:
INADA Naoki 2017-04-25 10:57:18 +09:00 committed by GitHub
parent f6448e5d65
commit 3e2ad8ec61
12 changed files with 65 additions and 223 deletions

View file

@ -19,20 +19,15 @@ import sys
import threading
import traceback
from asyncio import compat
def _get_function_source(func):
if compat.PY34:
func = inspect.unwrap(func)
elif hasattr(func, '__wrapped__'):
func = func.__wrapped__
func = inspect.unwrap(func)
if inspect.isfunction(func):
code = func.__code__
return (code.co_filename, code.co_firstlineno)
if isinstance(func, functools.partial):
return _get_function_source(func.func)
if compat.PY34 and isinstance(func, functools.partialmethod):
if isinstance(func, functools.partialmethod):
return _get_function_source(func.func)
return None