Blob Blame History Raw
From 8245a74aa4e090c40445535a9ce3997ed9904798 Mon Sep 17 00:00:00 2001
From: Dominic Davis-Foster <dominic@davis-foster.co.uk>
Date: Fri, 28 Jan 2022 23:11:52 +0000
Subject: [PATCH] Switch from inspect.getargspec to inspect.getfullargspec

inspect.getargspec has been deprecated since 3.0
---
 cherrypy/_cpdispatch.py | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/cherrypy/_cpdispatch.py b/cherrypy/_cpdispatch.py
index 83eb79cbe..5c506e997 100644
--- a/cherrypy/_cpdispatch.py
+++ b/cherrypy/_cpdispatch.py
@@ -206,12 +206,8 @@ 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]
+    def getargspec(callable):
+        return inspect.getfullargspec(callable)[:4]
 
 
 class LateParamPageHandler(PageHandler):