diff --git a/lib/cherrypy/_cpdispatch.py b/lib/cherrypy/_cpdispatch.py index 83eb79c..79a8a54 100644 --- a/lib/cherrypy/_cpdispatch.py +++ b/lib/cherrypy/_cpdispatch.py @@ -206,12 +206,14 @@ def test_callable_spec(callable, callable_args, callable_kwargs): def test_callable_spec(callable, args, kwargs): # noqa: F811 return None else: - getargspec = inspect.getargspec # Python 3 requires using getfullargspec if # keyword-only arguments are present if hasattr(inspect, 'getfullargspec'): def getargspec(callable): return inspect.getfullargspec(callable)[:4] + # Use getargspec with Python 2 + else: + getargspec = inspect.getargspec class LateParamPageHandler(PageHandler):