summaryrefslogtreecommitdiff
blob: 5d629dd8c33302b9a758651577f3949aed5aa350 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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 83eb79cb..5c506e99 100644
--- a/cherrypy/_cpdispatch.py
+++ b/cherrypy/_cpdispatch.py
@@ -206,12 +206,8 @@ except ImportError:
     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):
-- 
2.35.1