File: replace-getargspec-with-getfullargspec.patch

package info (click to toggle)
python-configshell-fb 1%3A1.1.28-2.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 396 kB
  • sloc: python: 3,277; makefile: 62
file content (31 lines) | stat: -rw-r--r-- 1,178 bytes parent folder | download
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
Description: replace getargspec() with getfullargspec()
 inspect.getargspec() doesn't work anymore with Python3.11
Author: Maurizio Lombardi <mlombard@redhat.com>
Origin: https://github.com/open-iscsi/configshell-fb/commit/f3ac914861bd605e3d634aeeb5e706abdbd39259
Forwarded: not-needed
Bug-Debian: https://bugs.debian.org/1028996

--- a/configshell/node.py
+++ b/configshell/node.py
@@ -1417,10 +1417,10 @@ class ConfigNode(object):
         @type kparams: dict
         @raise ExecutionError: When the check fails.
         '''
-        spec = inspect.getargspec(method)
+        spec = inspect.getfullargspec(method)
         args = spec.args[1:]
         pp = spec.varargs
-        kw = spec.keywords
+        kw = spec.varkw
 
         if spec.defaults is None:
             nb_opt_params = 0
@@ -1460,7 +1460,7 @@ class ConfigNode(object):
                 "Missing required parameters %s"
                 % ", ".join("'%s'" % missing for missing in missing_params))
 
-        if spec.keywords is None:
+        if kw is None:
             if len(unexpected_keywords) == 1:
                 raise ExecutionError(
                     "Unexpected keyword parameter '%s'."