Skip to content
Myr

Merge pull request #3957 from pgjones/fix

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Bugfix iscoroutinefunction with Python3.7

authored by David Lord · committed by GitHub · parents 5f03ad3, 6d5ccde · Browse files · 1 file+16 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+16 added−1 removed

  • other:+16 added−1 removed

1 file+16 added−1 removed

modified:src/flask/app.py+16 added-1 removed
1import functools2import inspect3import os4import sys5import weakref6from datetime import timedelta5from inspect import iscoroutinefunction7from itertools import chain8from threading import Lock910from werkzeug.datastructures import Headers
45 unmodified lines
56from .wrappers import Request57from .wrappers import Response585960if sys.version_info >= (3, 8):61 iscoroutinefunction = inspect.iscoroutinefunction62else:6364 def iscoroutinefunction(func):65 while inspect.ismethod(func):66 func = func.__func__6768 while isinstance(func, functools.partial):69 func = func.func7071 return inspect.iscoroutinefunction(func)727374def _make_timedelta(value):75 if value is None or isinstance(value, timedelta):76 return value77
1910 unmodified lines