forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit72a3d04
committed
Prepare for Python "Limited API" in PL/Python
Using the Python Limited API would allow building PL/Python againstany Python 3.x version and using another Python 3.x version at runtime. This commit does not activate that, but it prepares the code toonly use APIs supported by the Limited API.Implementation details:- Convert static types to heap types (https://docs.python.org/3/howto/isolating-extensions.html#heap-types).- Replace PyRun_String() with component functions.- Replace PyList_SET_ITEM() with PyList_SetItem().This was previously committed asc47e8df and then reverted becauseit wasn't working under Python older than 3.8. That has been fixed inthis version. There was a Python API change/bugfix between 3.7 and3.8 that directly affects this patch. The relevant commit is<python/cpython@364f0b0f19c>. Theworkarounds described there have been applied in this patch, and ithas been confirmed to work with Python 3.6 and 3.7.Reviewed-by: Jakob Egger <jakob@eggerapps.at>Discussion:https://www.postgresql.org/message-id/flat/ee410de1-1e0b-4770-b125-eeefd4726a24@eisentraut.org1 parentc872516 commit72a3d04
File tree
6 files changed
+213
-107
lines changed- src/pl/plpython
6 files changed
+213
-107
lines changedLines changed: 59 additions & 25 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
20 | 20 |
| |
21 | 21 |
| |
22 | 22 |
| |
23 |
| - | |
| 23 | + | |
24 | 24 |
| |
25 | 25 |
| |
26 | 26 |
| |
| |||
33 | 33 |
| |
34 | 34 |
| |
35 | 35 |
| |
36 |
| - | |
37 |
| - | |
38 |
| - | |
39 |
| - | |
40 |
| - | |
41 |
| - | |
42 |
| - | |
43 |
| - | |
44 |
| - | |
45 |
| - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
46 | 56 |
| |
47 | 57 |
| |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
48 | 68 |
| |
49 | 69 |
| |
50 | 70 |
| |
51 |
| - | |
| 71 | + | |
| 72 | + | |
52 | 73 |
| |
53 | 74 |
| |
54 | 75 |
| |
| |||
80 | 101 |
| |
81 | 102 |
| |
82 | 103 |
| |
83 |
| - | |
| 104 | + | |
84 | 105 |
| |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
85 | 110 |
| |
86 | 111 |
| |
87 | 112 |
| |
| |||
177 | 202 |
| |
178 | 203 |
| |
179 | 204 |
| |
180 |
| - | |
| 205 | + | |
181 | 206 |
| |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
182 | 211 |
| |
183 | 212 |
| |
184 | 213 |
| |
| |||
272 | 301 |
| |
273 | 302 |
| |
274 | 303 |
| |
275 |
| - | |
| 304 | + | |
276 | 305 |
| |
277 |
| - | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
278 | 309 |
| |
279 | 310 |
| |
280 |
| - | |
281 |
| - | |
282 |
| - | |
| 311 | + | |
283 | 312 |
| |
284 |
| - | |
| 313 | + | |
285 | 314 |
| |
286 | 315 |
| |
287 | 316 |
| |
288 | 317 |
| |
289 | 318 |
| |
290 | 319 |
| |
291 |
| - | |
| 320 | + | |
292 | 321 |
| |
293 |
| - | |
| 322 | + | |
294 | 323 |
| |
295 |
| - | |
296 |
| - | |
| 324 | + | |
| 325 | + | |
297 | 326 |
| |
298 |
| - | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
299 | 333 |
| |
300 | 334 |
| |
301 | 335 |
| |
|
Lines changed: 49 additions & 21 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
15 |
| - | |
| 15 | + | |
16 | 16 |
| |
17 | 17 |
| |
18 | 18 |
| |
| |||
26 | 26 |
| |
27 | 27 |
| |
28 | 28 |
| |
29 |
| - | |
30 |
| - | |
31 |
| - | |
32 |
| - | |
33 |
| - | |
34 |
| - | |
35 |
| - | |
36 |
| - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
37 | 43 |
| |
38 | 44 |
| |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
39 | 55 |
| |
40 | 56 |
| |
41 | 57 |
| |
42 |
| - | |
| 58 | + | |
| 59 | + | |
43 | 60 |
| |
44 | 61 |
| |
45 | 62 |
| |
| |||
48 | 65 |
| |
49 | 66 |
| |
50 | 67 |
| |
51 |
| - | |
| 68 | + | |
52 | 69 |
| |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
53 | 74 |
| |
54 | 75 |
| |
55 | 76 |
| |
| |||
63 | 84 |
| |
64 | 85 |
| |
65 | 86 |
| |
66 |
| - | |
| 87 | + | |
67 | 88 |
| |
68 | 89 |
| |
69 | 90 |
| |
70 |
| - | |
| 91 | + | |
71 | 92 |
| |
72 |
| - | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
73 | 96 |
| |
74 |
| - | |
| 97 | + | |
75 | 98 |
| |
76 |
| - | |
77 |
| - | |
| 99 | + | |
| 100 | + | |
78 | 101 |
| |
79 |
| - | |
| 102 | + | |
80 | 103 |
| |
81 |
| - | |
82 |
| - | |
| 104 | + | |
| 105 | + | |
83 | 106 |
| |
84 |
| - | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
85 | 113 |
| |
86 | 114 |
| |
87 | 115 |
| |
|
Lines changed: 4 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
350 | 350 |
| |
351 | 351 |
| |
352 | 352 |
| |
| 353 | + | |
353 | 354 |
| |
354 | 355 |
| |
355 | 356 |
| |
| |||
368 | 369 |
| |
369 | 370 |
| |
370 | 371 |
| |
371 |
| - | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
372 | 375 |
| |
373 | 376 |
| |
374 | 377 |
| |
|
0 commit comments
Comments
(0)