File: 0061-Fix-CodeType-usage.patch

package info (click to toggle)
numba 0.56.4%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 23,672 kB
  • sloc: python: 183,651; ansic: 15,370; cpp: 2,259; javascript: 424; sh: 308; makefile: 174
file content (35 lines) | stat: -rw-r--r-- 1,443 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
32
33
34
35
From 6db234d9647a20d7d46135352f5f2c8b26307ea7 Mon Sep 17 00:00:00 2001
Origin: https://github.com/numba/numba/pull/8590
From: Siu Kwan Lam <1929845+sklam@users.noreply.github.com>
Date: Wed, 16 Nov 2022 18:53:04 -0600
Subject: [PATCH 07/14] Fix CodeType usage

---
 numba/tests/test_analysis.py | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/numba/tests/test_analysis.py b/numba/tests/test_analysis.py
index 82ea42a456b..22e4158f98d 100644
--- a/numba/tests/test_analysis.py
+++ b/numba/tests/test_analysis.py
@@ -674,10 +674,15 @@ def _literal_const_sample_generator(self, pyfunc, consts):
                         pyfunc_code.co_names,
                         pyfunc_code.co_varnames,
                         pyfunc_code.co_filename,
-                        pyfunc_code.co_name,
-                        pyfunc_code.co_firstlineno,
-                        pyfunc_code.co_lnotab,
-                        pyfunc_code.co_freevars,
+                        pyfunc_code.co_name])
+
+        if utils.PYVERSION >= (3, 11):
+            co_args.append(pyfunc_code.co_qualname)
+        co_args.extend([pyfunc_code.co_firstlineno,
+                        pyfunc_code.co_lnotab])
+        if utils.PYVERSION >= (3, 11):
+            co_args.append(pyfunc_code.co_exceptiontable)
+        co_args.extend([pyfunc_code.co_freevars,
                         pyfunc_code.co_cellvars
                         ])