summaryrefslogtreecommitdiff
blob: b85027ec2b8d21fca244ed42e0ac21f8adb868f2 (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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
--- a/langkit/expressions/collections.py	2023-02-25 17:31:43.261369482 +0100
+++ b/langkit/expressions/collections.py	2023-02-25 17:32:03.068054949 +0100
@@ -265,15 +265,15 @@
             " function"
         )
 
-        argspec = inspect.getargspec(expr_fn)
+        argspec = inspect.getfullargspec(expr_fn)
 
         check_multiple([
             (len(argspec.args) in (1, 2),
              'Invalid collection iteration lambda: only one'
              ' or two parameters expected'),
-            (not argspec.varargs and not argspec.keywords,
+            (not argspec.varargs and not argspec.varkw,
              'Invalid collection iteration lambda: no *args or **kwargs'),
             (not argspec.defaults,
              'Invalid collection iteration lambda: No default values allowed'
                 'Invalid matcher lambda'
             )
--- a/langkit/expressions/structs.py	2023-02-25 17:32:21.884756077 +0100
+++ b/langkit/expressions/structs.py	2023-02-25 17:32:32.382589322 +0100
@@ -1327,9 +1327,9 @@
         self.matchers = []
 
         for i, match_fn in enumerate(self.matchers_functions):
-            argspec = inspect.getargspec(match_fn)
+            argspec = inspect.getfullargspec(match_fn)
             check_source_language(
                 len(argspec.args) == 1 and
                 not argspec.varargs and
-                not argspec.keywords and
+                not argspec.varkw and
                 (not argspec.defaults or len(argspec.defaults) < 2),
--- a/langkit/expressions/base.py	2023-02-25 17:29:35.964403798 +0100
+++ b/langkit/expressions/base.py	2023-02-25 17:30:28.362565456 +0100
@@ -158,11 +158,11 @@
     fn_arguments = []
     fn_expr = None
 
-    argspec = inspect.getargspec(fn)
+    argspec = inspect.getfullargspec(fn)
     defaults = argspec.defaults or []
 
     check_multiple([
-        (not argspec.varargs or not argspec.keywords, 'Invalid'
+        (not argspec.varargs or not argspec.varkw, 'Invalid'
          ' function signature: no *args nor **kwargs allowed'),
 
         (len(argspec.args) == len(defaults), 'All parameters '
@@ -2822,7 +2822,7 @@
             lambda_fn = None
 
         else:
-            argspec = inspect.getargspec(lambda_fn)
+            argspec = inspect.getfullargspec(lambda_fn)
 
             var_names = argspec.args
             var_exprs = argspec.defaults or []
@@ -2843,10 +2843,10 @@
         if self.lambda_fn is None:
             return
 
-        argspec = inspect.getargspec(self.lambda_fn)
+        argspec = inspect.getfullargspec(self.lambda_fn)
 
         check_multiple([
-            (not argspec.varargs and not argspec.keywords,
+            (not argspec.varargs and not argspec.varkw,
              'Invalid function for Let expression (*args and **kwargs '
              'not accepted)'),
 
--- a/langkit/expressions/boolean.py	2023-02-25 17:30:59.820062103 +0100
+++ b/langkit/expressions/boolean.py	2023-02-25 17:31:10.565890137 +0100
@@ -475,11 +475,11 @@
         if self.then_expr:
             return
 
-        argspec = inspect.getargspec(self.then_fn)
+        argspec = inspect.getfullargspec(self.then_fn)
         check_source_language(
             len(argspec.args) == 1
             and not argspec.varargs
-            and not argspec.keywords
+            and not argspec.varkw
             and not argspec.defaults,
             'Invalid lambda for Then expression: exactly one parameter is'
             ' required, without a default value'