Nuitka-winsvc 2.2.3__cp311-cp311-win_amd64.whl → 2.3.2__cp311-cp311-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of Nuitka-winsvc might be problematic. Click here for more details.
- {Nuitka_winsvc-2.2.3.dist-info → Nuitka_winsvc-2.3.2.dist-info}/METADATA +2 -1
- {Nuitka_winsvc-2.2.3.dist-info → Nuitka_winsvc-2.3.2.dist-info}/RECORD +201 -200
- nuitka/Bytecodes.py +4 -2
- nuitka/HardImportRegistry.py +1 -0
- nuitka/MainControl.py +16 -10
- nuitka/ModuleRegistry.py +15 -0
- nuitka/OptionParsing.py +30 -8
- nuitka/Options.py +106 -45
- nuitka/PostProcessing.py +9 -8
- nuitka/PythonVersions.py +2 -1
- nuitka/Serialization.py +47 -30
- nuitka/Version.py +1 -1
- nuitka/build/Backend.scons +46 -19
- nuitka/build/CCompilerVersion.scons +3 -3
- nuitka/build/Onefile.scons +4 -4
- nuitka/build/SconsCaching.py +3 -2
- nuitka/build/SconsCompilerSettings.py +18 -6
- nuitka/build/SconsInterface.py +28 -8
- nuitka/build/SconsUtils.py +9 -1
- nuitka/build/include/nuitka/allocator.h +58 -2
- nuitka/build/include/nuitka/compiled_frame.h +48 -13
- nuitka/build/include/nuitka/compiled_function.h +4 -0
- nuitka/build/include/nuitka/constants.h +6 -0
- nuitka/build/include/nuitka/exception_groups.h +6 -6
- nuitka/build/include/nuitka/exceptions.h +3 -3
- nuitka/build/include/nuitka/freelists.h +11 -0
- nuitka/build/include/nuitka/helper/dictionaries.h +5 -4
- nuitka/build/include/nuitka/helper/lists.h +5 -5
- nuitka/build/include/nuitka/helper/lists_generated.h +12 -12
- nuitka/build/include/nuitka/helper/sequences.h +6 -0
- nuitka/build/include/nuitka/helper/slices.h +14 -8
- nuitka/build/include/nuitka/helper/subscripts.h +1 -184
- nuitka/build/include/nuitka/helper/tuples.h +42 -33
- nuitka/build/include/nuitka/importing.h +5 -0
- nuitka/build/include/nuitka/prelude.h +49 -5
- nuitka/build/include/nuitka/safe_string_ops.h +1 -0
- nuitka/build/include/nuitka/threading.h +13 -10
- nuitka/build/static_src/CompiledAsyncgenType.c +19 -8
- nuitka/build/static_src/CompiledCellType.c +1 -1
- nuitka/build/static_src/CompiledCodeHelpers.c +18 -16
- nuitka/build/static_src/CompiledCoroutineType.c +23 -19
- nuitka/build/static_src/CompiledFrameType.c +46 -34
- nuitka/build/static_src/CompiledFunctionType.c +55 -34
- nuitka/build/static_src/CompiledGeneratorType.c +21 -19
- nuitka/build/static_src/CompiledGeneratorTypeUncompiledIntegration.c +127 -130
- nuitka/build/static_src/CompiledMethodType.c +15 -17
- nuitka/build/static_src/HelpersAllocator.c +71 -0
- nuitka/build/static_src/HelpersAttributes.c +1 -1
- nuitka/build/static_src/HelpersBuiltin.c +5 -5
- nuitka/build/static_src/HelpersBytes.c +2 -2
- nuitka/build/static_src/HelpersCalling.c +3 -0
- nuitka/build/static_src/HelpersCallingGenerated.c +952 -133
- nuitka/build/static_src/HelpersComparisonEq.c +329 -329
- nuitka/build/static_src/HelpersComparisonEqUtils.c +3 -1
- nuitka/build/static_src/HelpersComparisonGe.c +322 -322
- nuitka/build/static_src/HelpersComparisonGt.c +321 -321
- nuitka/build/static_src/HelpersComparisonLe.c +322 -322
- nuitka/build/static_src/HelpersComparisonLt.c +321 -321
- nuitka/build/static_src/HelpersComparisonNe.c +329 -329
- nuitka/build/static_src/HelpersConsole.c +96 -0
- nuitka/build/static_src/HelpersConstantsBlob.c +10 -6
- nuitka/build/static_src/HelpersDeepcopy.c +10 -8
- nuitka/build/static_src/HelpersDictionaries.c +17 -11
- nuitka/build/static_src/HelpersDictionariesGenerated.c +65 -29
- nuitka/build/static_src/HelpersExceptions.c +107 -9
- nuitka/build/static_src/HelpersFilesystemPaths.c +64 -4
- nuitka/build/static_src/HelpersFloats.c +20 -14
- nuitka/build/static_src/HelpersImport.c +1 -1
- nuitka/build/static_src/HelpersJitSources.c +1 -1
- nuitka/build/static_src/HelpersLists.c +29 -19
- nuitka/build/static_src/HelpersListsGenerated.c +24 -24
- nuitka/build/static_src/HelpersMatching.c +32 -5
- nuitka/build/static_src/HelpersOperationBinaryAdd.c +90 -63
- nuitka/build/static_src/HelpersOperationBinaryAddUtils.c +4 -4
- nuitka/build/static_src/HelpersOperationBinaryBitand.c +33 -33
- nuitka/build/static_src/HelpersOperationBinaryBitor.c +33 -33
- nuitka/build/static_src/HelpersOperationBinaryBitxor.c +33 -33
- nuitka/build/static_src/HelpersOperationBinaryDivmod.c +24 -24
- nuitka/build/static_src/HelpersOperationBinaryFloordiv.c +24 -24
- nuitka/build/static_src/HelpersOperationBinaryLshift.c +30 -30
- nuitka/build/static_src/HelpersOperationBinaryMatmult.c +7 -7
- nuitka/build/static_src/HelpersOperationBinaryMod.c +90 -90
- nuitka/build/static_src/HelpersOperationBinaryMult.c +64 -58
- nuitka/build/static_src/HelpersOperationBinaryOlddiv.c +24 -24
- nuitka/build/static_src/HelpersOperationBinaryPow.c +27 -27
- nuitka/build/static_src/HelpersOperationBinaryRshift.c +30 -30
- nuitka/build/static_src/HelpersOperationBinarySub.c +24 -24
- nuitka/build/static_src/HelpersOperationBinaryTruediv.c +24 -24
- nuitka/build/static_src/HelpersOperationInplaceAdd.c +67 -49
- nuitka/build/static_src/HelpersOperationInplaceBitand.c +25 -25
- nuitka/build/static_src/HelpersOperationInplaceBitor.c +25 -25
- nuitka/build/static_src/HelpersOperationInplaceBitxor.c +25 -25
- nuitka/build/static_src/HelpersOperationInplaceFloordiv.c +28 -28
- nuitka/build/static_src/HelpersOperationInplaceLshift.c +18 -18
- nuitka/build/static_src/HelpersOperationInplaceMatmult.c +10 -10
- nuitka/build/static_src/HelpersOperationInplaceMod.c +70 -70
- nuitka/build/static_src/HelpersOperationInplaceMult.c +33 -33
- nuitka/build/static_src/HelpersOperationInplaceOlddiv.c +28 -28
- nuitka/build/static_src/HelpersOperationInplacePow.c +28 -28
- nuitka/build/static_src/HelpersOperationInplaceRshift.c +18 -18
- nuitka/build/static_src/HelpersOperationInplaceSub.c +28 -28
- nuitka/build/static_src/HelpersOperationInplaceTruediv.c +28 -28
- nuitka/build/static_src/HelpersRaising.c +10 -3
- nuitka/build/static_src/HelpersSafeStrings.c +14 -4
- nuitka/build/static_src/HelpersSlices.c +12 -5
- nuitka/build/static_src/HelpersStrings.c +1 -1
- nuitka/build/static_src/HelpersTuples.c +20 -15
- nuitka/build/static_src/InspectPatcher.c +74 -6
- nuitka/build/static_src/MainProgram.c +90 -25
- nuitka/build/static_src/MetaPathBasedLoader.c +81 -45
- nuitka/build/static_src/MetaPathBasedLoaderResourceReaderFiles.c +2 -2
- nuitka/build/static_src/OnefileBootstrap.c +16 -17
- nuitka/code_generation/CodeGeneration.py +5 -2
- nuitka/code_generation/ConstantCodes.py +2 -2
- nuitka/code_generation/DictCodes.py +2 -2
- nuitka/code_generation/GlobalConstants.py +5 -0
- nuitka/code_generation/GlobalsLocalsCodes.py +2 -2
- nuitka/code_generation/ListCodes.py +2 -2
- nuitka/code_generation/LocalsDictCodes.py +1 -1
- nuitka/code_generation/ModuleCodes.py +19 -0
- nuitka/code_generation/PackageResourceCodes.py +14 -0
- nuitka/code_generation/SliceCodes.py +3 -3
- nuitka/code_generation/SubscriptCodes.py +5 -13
- nuitka/code_generation/TupleCodes.py +1 -1
- nuitka/code_generation/c_types/CTypePyObjectPointers.py +7 -7
- nuitka/code_generation/templates/CodeTemplatesConstants.py +7 -5
- nuitka/code_generation/templates/CodeTemplatesLoader.py +2 -0
- nuitka/code_generation/templates/CodeTemplatesModules.py +80 -54
- nuitka/code_generation/templates_c/CodeTemplateCallsMixed.c.j2 +1 -1
- nuitka/code_generation/templates_c/CodeTemplateCallsPositional.c.j2 +59 -8
- nuitka/code_generation/templates_c/CodeTemplateCallsPositionalMethodDescr.c.j2 +5 -5
- nuitka/code_generation/templates_c/CodeTemplateMakeListHinted.c.j2 +2 -2
- nuitka/code_generation/templates_c/CodeTemplateMakeListSmall.c.j2 +2 -2
- nuitka/code_generation/templates_c/HelperDictionaryCopy.c.j2 +57 -21
- nuitka/code_generation/templates_c/HelperImportHard.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperOperationBinary.c.j2 +5 -5
- nuitka/code_generation/templates_c/HelperOperationComparison.c.j2 +18 -18
- nuitka/code_generation/templates_c/HelperOperationComparisonBytes.c.j2 +11 -11
- nuitka/code_generation/templates_c/HelperOperationComparisonFloat.c.j2 +3 -3
- nuitka/code_generation/templates_c/HelperOperationComparisonInt.c.j2 +3 -3
- nuitka/code_generation/templates_c/HelperOperationComparisonList.c.j2 +7 -7
- nuitka/code_generation/templates_c/HelperOperationComparisonLong.c.j2 +3 -3
- nuitka/code_generation/templates_c/HelperOperationComparisonStr.c.j2 +11 -11
- nuitka/code_generation/templates_c/HelperOperationComparisonTuple.c.j2 +7 -7
- nuitka/code_generation/templates_c/HelperOperationComparisonUnicode.c.j2 +10 -10
- nuitka/code_generation/templates_c/HelperOperationInplace.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperSlotsBinary.c.j2 +3 -3
- nuitka/code_generation/templates_c/HelperSlotsList.c.j2 +4 -1
- nuitka/code_generation/templates_c/HelperSlotsTuple.c.j2 +4 -1
- nuitka/finalizations/FinalizeMarkups.py +0 -18
- nuitka/freezer/DependsExe.py +9 -4
- nuitka/freezer/DllDependenciesMacOS.py +1 -1
- nuitka/freezer/DllDependenciesWin32.py +1 -1
- nuitka/freezer/ImportDetection.py +1 -0
- nuitka/freezer/IncludedDataFiles.py +13 -4
- nuitka/freezer/IncludedEntryPoints.py +16 -0
- nuitka/freezer/Onefile.py +0 -1
- nuitka/freezer/Standalone.py +38 -21
- nuitka/importing/ImportCache.py +3 -2
- nuitka/importing/Importing.py +16 -3
- nuitka/importing/StandardLibrary.py +4 -0
- nuitka/nodes/ChildrenHavingMixins.py +2 -0
- nuitka/nodes/ExpressionBasesGenerated.py +4 -0
- nuitka/nodes/HardImportNodesGenerated.py +83 -0
- nuitka/nodes/ModuleNodes.py +10 -2
- nuitka/nodes/OsSysNodes.py +16 -0
- nuitka/nodes/SubscriptNodes.py +3 -3
- nuitka/plugins/PluginBase.py +2 -0
- nuitka/plugins/standard/DataFilesPlugin.py +22 -1
- nuitka/plugins/standard/DillPlugin/DillPlugin.c +3 -3
- nuitka/plugins/standard/ImplicitImports.py +3 -0
- nuitka/plugins/standard/OptionsNannyPlugin.py +9 -41
- nuitka/plugins/standard/PkgResourcesPlugin.py +8 -2
- nuitka/plugins/standard/PySidePyQtPlugin.py +3 -0
- nuitka/plugins/standard/standard.nuitka-package.config.yml +28 -13
- nuitka/plugins/standard/stdlib2.nuitka-package.config.yml +2 -2
- nuitka/plugins/standard/stdlib3.nuitka-package.config.yml +7 -2
- nuitka/specs/HardImportSpecs.py +3 -0
- nuitka/specs/ParameterSpecs.py +26 -15
- nuitka/tools/general/find_module/FindModuleCode.py +3 -2
- nuitka/tools/specialize/CTypeDescriptions.py +11 -9
- nuitka/tools/testing/Common.py +12 -5
- nuitka/tools/testing/SearchModes.py +5 -1
- nuitka/tools/testing/run_nuitka_tests/__main__.py +37 -0
- nuitka/tools/watch/GitHub.py +1 -7
- nuitka/tree/Building.py +9 -6
- nuitka/tree/ReformulationMatchStatements.py +51 -14
- nuitka/tree/TreeHelpers.py +8 -0
- nuitka/utils/CStrings.py +7 -0
- nuitka/utils/Execution.py +10 -1
- nuitka/utils/FileOperations.py +21 -13
- nuitka/utils/Importing.py +24 -0
- nuitka/utils/ReExecute.py +12 -3
- nuitka/utils/SharedLibraries.py +26 -1
- nuitka/utils/Yaml.py +9 -1
- {Nuitka_winsvc-2.2.3.data → Nuitka_winsvc-2.3.2.data}/scripts/nuitka-run.bat +0 -0
- {Nuitka_winsvc-2.2.3.data → Nuitka_winsvc-2.3.2.data}/scripts/nuitka.bat +0 -0
- {Nuitka_winsvc-2.2.3.dist-info → Nuitka_winsvc-2.3.2.dist-info}/LICENSE.txt +0 -0
- {Nuitka_winsvc-2.2.3.dist-info → Nuitka_winsvc-2.3.2.dist-info}/WHEEL +0 -0
- {Nuitka_winsvc-2.2.3.dist-info → Nuitka_winsvc-2.3.2.dist-info}/entry_points.txt +0 -0
- {Nuitka_winsvc-2.2.3.dist-info → Nuitka_winsvc-2.3.2.dist-info}/top_level.txt +0 -0
|
@@ -106,12 +106,23 @@ extern _PyRuntimeState _PyRuntime;
|
|
|
106
106
|
|
|
107
107
|
static inline size_t Nuitka_static_builtin_index_get(PyTypeObject *self) { return (size_t)self->tp_subclasses - 1; }
|
|
108
108
|
|
|
109
|
-
|
|
109
|
+
// Changed internal type access for Python3.13
|
|
110
|
+
#if PYTHON_VERSION < 0x3d0
|
|
111
|
+
#define managed_static_type_state static_builtin_state
|
|
112
|
+
|
|
113
|
+
static inline managed_static_type_state *Nuitka_static_builtin_state_get(PyInterpreterState *interp,
|
|
114
|
+
PyTypeObject *self) {
|
|
110
115
|
return &(interp->types.builtins[Nuitka_static_builtin_index_get(self)]);
|
|
111
116
|
}
|
|
117
|
+
#else
|
|
118
|
+
static inline managed_static_type_state *Nuitka_static_builtin_state_get(PyInterpreterState *interp,
|
|
119
|
+
PyTypeObject *self) {
|
|
120
|
+
return &(interp->types.builtins.initialized[Nuitka_static_builtin_index_get(self)]);
|
|
121
|
+
}
|
|
122
|
+
#endif
|
|
112
123
|
|
|
113
|
-
NUITKA_MAY_BE_UNUSED static inline
|
|
114
|
-
|
|
124
|
+
NUITKA_MAY_BE_UNUSED static inline managed_static_type_state *Nuitka_PyStaticType_GetState(PyInterpreterState *interp,
|
|
125
|
+
PyTypeObject *self) {
|
|
115
126
|
assert(self->tp_flags & _Py_TPFLAGS_STATIC_BUILTIN);
|
|
116
127
|
return Nuitka_static_builtin_state_get(interp, self);
|
|
117
128
|
}
|
|
@@ -148,7 +159,11 @@ NUITKA_MAY_BE_UNUSED static inline static_builtin_state *Nuitka_PyStaticType_Get
|
|
|
148
159
|
|
|
149
160
|
// Uncompiled generator integration requires these.
|
|
150
161
|
#if PYTHON_VERSION >= 0x3b0
|
|
162
|
+
#if PYTHON_VERSION >= 0x3d0
|
|
163
|
+
#include <opcode_ids.h>
|
|
164
|
+
#else
|
|
151
165
|
#include <internal/pycore_opcode.h>
|
|
166
|
+
#endif
|
|
152
167
|
// Clashes with our helper names.
|
|
153
168
|
#undef CALL_FUNCTION
|
|
154
169
|
#endif
|
|
@@ -170,6 +185,13 @@ NUITKA_MAY_BE_UNUSED static inline static_builtin_state *Nuitka_PyStaticType_Get
|
|
|
170
185
|
#include <objimpl.h>
|
|
171
186
|
#endif
|
|
172
187
|
|
|
188
|
+
#if PYTHON_VERSION >= 0x3d0
|
|
189
|
+
#include <internal/pycore_freelist.h>
|
|
190
|
+
#include <internal/pycore_intrinsics.h>
|
|
191
|
+
#include <internal/pycore_modsupport.h>
|
|
192
|
+
#include <internal/pycore_setobject.h>
|
|
193
|
+
#endif
|
|
194
|
+
|
|
173
195
|
#undef Py_BUILD_CORE
|
|
174
196
|
|
|
175
197
|
#endif
|
|
@@ -272,8 +294,15 @@ NUITKA_MAY_BE_UNUSED static inline bool Nuitka_StringOrUnicode_CheckExact(PyObje
|
|
|
272
294
|
#define PyUnicode_UTF8(op) \
|
|
273
295
|
(assert(PyUnicode_IS_READY(op)), \
|
|
274
296
|
PyUnicode_IS_COMPACT_ASCII(op) ? ((char *)((PyASCIIObject *)(op) + 1)) : _PyUnicode_UTF8(op))
|
|
297
|
+
#ifdef __NUITKA_NO_ASSERT__
|
|
275
298
|
#define Nuitka_String_AsString_Unchecked PyUnicode_UTF8
|
|
276
|
-
|
|
299
|
+
#else
|
|
300
|
+
NUITKA_MAY_BE_UNUSED static char const *Nuitka_String_AsString_Unchecked(PyObject *object) {
|
|
301
|
+
char const *result = PyUnicode_UTF8(object);
|
|
302
|
+
assert(result != NULL);
|
|
303
|
+
return result;
|
|
304
|
+
}
|
|
305
|
+
#endif
|
|
277
306
|
#define Nuitka_String_Check PyUnicode_Check
|
|
278
307
|
#define Nuitka_String_CheckExact PyUnicode_CheckExact
|
|
279
308
|
#define Nuitka_StringOrUnicode_CheckExact PyUnicode_CheckExact
|
|
@@ -412,6 +441,21 @@ extern PyThreadState *_PyThreadState_Current;
|
|
|
412
441
|
#define PyFloat_SET_DOUBLE(op, value) ((PyFloatObject *)(op))->ob_fval = value
|
|
413
442
|
#endif
|
|
414
443
|
|
|
444
|
+
#ifndef Py_NewRef
|
|
445
|
+
static inline PyObject *_Py_NewRef(PyObject *obj) {
|
|
446
|
+
Py_INCREF(obj);
|
|
447
|
+
return obj;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
static inline PyObject *_Py_XNewRef(PyObject *obj) {
|
|
451
|
+
Py_XINCREF(obj);
|
|
452
|
+
return obj;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
#define Py_NewRef(obj) _Py_NewRef((PyObject *)(obj))
|
|
456
|
+
#define Py_XNewRef(obj) _Py_XNewRef((PyObject *)(obj))
|
|
457
|
+
#endif
|
|
458
|
+
|
|
415
459
|
// For older Python, we don't have a feature "CLASS" anymore, that's implied now.
|
|
416
460
|
#if PYTHON_VERSION < 0x300
|
|
417
461
|
#define NuitkaType_HasFeatureClass(descr) (PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))
|
|
@@ -452,7 +496,7 @@ typedef long nuitka_digit;
|
|
|
452
496
|
#include "nuitka/compiled_function.h"
|
|
453
497
|
|
|
454
498
|
/* Sentinel PyObject to be used for all our call iterator endings. */
|
|
455
|
-
extern PyObject *
|
|
499
|
+
extern PyObject *Nuitka_sentinel_value;
|
|
456
500
|
|
|
457
501
|
/* Value to use for __compiled__ value of all modules. */
|
|
458
502
|
extern PyObject *Nuitka_dunder_compiled_value;
|
|
@@ -19,6 +19,7 @@ extern void appendStringSafe(char *target, char const *source, size_t buffer_siz
|
|
|
19
19
|
|
|
20
20
|
/* Safe to use functions to append a wide char string, will abort program for overflow. */
|
|
21
21
|
extern void appendCharSafeW(wchar_t *target, char c, size_t buffer_size);
|
|
22
|
+
extern void appendWCharSafeW(wchar_t *target, wchar_t c, size_t buffer_size);
|
|
22
23
|
extern void appendStringSafeW(wchar_t *target, char const *source, size_t buffer_size);
|
|
23
24
|
extern void appendWStringSafeW(wchar_t *target, wchar_t const *source, size_t buffer_size);
|
|
24
25
|
|
|
@@ -14,19 +14,24 @@ extern volatile int _Py_Ticker;
|
|
|
14
14
|
#ifdef NUITKA_USE_PYCORE_THREAD_STATE
|
|
15
15
|
|
|
16
16
|
#if PYTHON_VERSION < 0x380
|
|
17
|
+
|
|
17
18
|
// Signals pending got their own indicator only in 3.8, covered by calls to do before.
|
|
18
19
|
#define HAS_WORK_TO_DO(ceval, ceval2) (ceval2->pending.calls_to_do._value)
|
|
19
|
-
#
|
|
20
|
+
#elif PYTHON_VERSION < 0x3d0
|
|
20
21
|
#define HAS_WORK_TO_DO(ceval, ceval2) (ceval->signals_pending._value || ceval2->pending.calls_to_do._value)
|
|
22
|
+
#else
|
|
23
|
+
#define HAS_WORK_TO_DO(ceval, ceval2) _Py_eval_breaker_bit_is_set(tstate, _PY_SIGNALS_PENDING_BIT | _PY_CALLS_TO_DO_BIT)
|
|
21
24
|
#endif
|
|
22
25
|
|
|
26
|
+
#ifndef Py_GIL_DISABLED
|
|
23
27
|
NUITKA_MAY_BE_UNUSED static inline bool CONSIDER_THREADING(PyThreadState *tstate) {
|
|
24
|
-
#if PYTHON_VERSION
|
|
25
|
-
_PyRuntimeState *const runtime = tstate->interp->runtime;
|
|
26
|
-
#else
|
|
28
|
+
#if PYTHON_VERSION < 0x390
|
|
27
29
|
_PyRuntimeState *const runtime = &_PyRuntime;
|
|
30
|
+
#else
|
|
31
|
+
_PyRuntimeState *const runtime = tstate->interp->runtime;
|
|
28
32
|
#endif
|
|
29
33
|
|
|
34
|
+
#if PYTHON_VERSION < 0x3d0
|
|
30
35
|
// This was split in 2 parts in 3.9 or higher.
|
|
31
36
|
struct _ceval_runtime_state *ceval = &runtime->ceval;
|
|
32
37
|
#if PYTHON_VERSION >= 0x390
|
|
@@ -34,7 +39,7 @@ NUITKA_MAY_BE_UNUSED static inline bool CONSIDER_THREADING(PyThreadState *tstate
|
|
|
34
39
|
#else
|
|
35
40
|
struct _ceval_runtime_state *ceval2 = ceval;
|
|
36
41
|
#endif
|
|
37
|
-
|
|
42
|
+
#endif
|
|
38
43
|
// Pending signals or calls to do
|
|
39
44
|
if (HAS_WORK_TO_DO(ceval, ceval2)) {
|
|
40
45
|
int res = Py_MakePendingCalls();
|
|
@@ -44,12 +49,9 @@ NUITKA_MAY_BE_UNUSED static inline bool CONSIDER_THREADING(PyThreadState *tstate
|
|
|
44
49
|
}
|
|
45
50
|
}
|
|
46
51
|
|
|
47
|
-
#
|
|
48
|
-
/* load eval breaker */
|
|
49
|
-
uintptr_t b = _Py_atomic_load_uintptr(&tstate->eval_breaker);
|
|
50
|
-
|
|
52
|
+
#if PYTHON_VERSION >= 0x3d0
|
|
51
53
|
/* GIL drop request */
|
|
52
|
-
if ((
|
|
54
|
+
if (_Py_eval_breaker_bit_is_set(tstate, _PY_GIL_DROP_REQUEST_BIT)) {
|
|
53
55
|
#else
|
|
54
56
|
/* GIL drop request */
|
|
55
57
|
if (ceval2->gil_drop_request._value) {
|
|
@@ -70,6 +72,7 @@ NUITKA_MAY_BE_UNUSED static inline bool CONSIDER_THREADING(PyThreadState *tstate
|
|
|
70
72
|
|
|
71
73
|
return true;
|
|
72
74
|
}
|
|
75
|
+
#endif
|
|
73
76
|
|
|
74
77
|
#else
|
|
75
78
|
|
|
@@ -124,7 +124,7 @@ static PyObject *Nuitka_Asyncgen_get_ag_await(struct Nuitka_AsyncgenObject *asyn
|
|
|
124
124
|
Py_INCREF(asyncgen->m_yield_from);
|
|
125
125
|
return asyncgen->m_yield_from;
|
|
126
126
|
} else {
|
|
127
|
-
|
|
127
|
+
Py_INCREF_IMMORTAL(Py_None);
|
|
128
128
|
return Py_None;
|
|
129
129
|
}
|
|
130
130
|
}
|
|
@@ -154,7 +154,7 @@ static PyObject *Nuitka_Asyncgen_get_frame(struct Nuitka_AsyncgenObject *asyncge
|
|
|
154
154
|
Py_INCREF(asyncgen->m_frame);
|
|
155
155
|
return (PyObject *)asyncgen->m_frame;
|
|
156
156
|
} else {
|
|
157
|
-
|
|
157
|
+
Py_INCREF_IMMORTAL(Py_None);
|
|
158
158
|
return Py_None;
|
|
159
159
|
}
|
|
160
160
|
}
|
|
@@ -1352,7 +1352,13 @@ struct _PyAsyncGenWrappedValue {
|
|
|
1352
1352
|
PyObject *agw_val;
|
|
1353
1353
|
};
|
|
1354
1354
|
|
|
1355
|
+
#if PYTHON_VERSION < 0x3d0
|
|
1355
1356
|
#define _PyAsyncGenWrappedValue_CheckExact(o) (Py_TYPE(o) == &_PyAsyncGenWrappedValue_Type)
|
|
1357
|
+
#else
|
|
1358
|
+
static PyTypeObject *Nuitka_PyAsyncGenWrappedValue_Type = NULL;
|
|
1359
|
+
|
|
1360
|
+
#define _PyAsyncGenWrappedValue_CheckExact(o) (Py_TYPE(o) == Nuitka_PyAsyncGenWrappedValue_Type)
|
|
1361
|
+
#endif
|
|
1356
1362
|
|
|
1357
1363
|
static PyObject *_Nuitka_Asyncgen_unwrap_value(PyThreadState *tstate, struct Nuitka_AsyncgenObject *asyncgen,
|
|
1358
1364
|
PyObject *result) {
|
|
@@ -1378,9 +1384,7 @@ static PyObject *_Nuitka_Asyncgen_unwrap_value(PyThreadState *tstate, struct Nui
|
|
|
1378
1384
|
|
|
1379
1385
|
if (_PyAsyncGenWrappedValue_CheckExact(result)) {
|
|
1380
1386
|
/* async yield */
|
|
1381
|
-
|
|
1382
|
-
// helper, "Nuitka_SetStopIterationValue" should be usable instead.
|
|
1383
|
-
_PyGen_SetStopIterationValue(((struct _PyAsyncGenWrappedValue *)result)->agw_val);
|
|
1387
|
+
Nuitka_SetStopIterationValue(tstate, ((struct _PyAsyncGenWrappedValue *)result)->agw_val);
|
|
1384
1388
|
|
|
1385
1389
|
Py_DECREF(result);
|
|
1386
1390
|
|
|
@@ -1390,7 +1394,7 @@ static PyObject *_Nuitka_Asyncgen_unwrap_value(PyThreadState *tstate, struct Nui
|
|
|
1390
1394
|
return NULL;
|
|
1391
1395
|
} else if (Nuitka_AsyncgenWrappedValue_CheckExact(result)) {
|
|
1392
1396
|
/* async yield */
|
|
1393
|
-
|
|
1397
|
+
Nuitka_SetStopIterationValue(tstate, ((struct Nuitka_AsyncgenWrappedValueObject *)result)->m_value);
|
|
1394
1398
|
|
|
1395
1399
|
Py_DECREF(result);
|
|
1396
1400
|
|
|
@@ -1642,7 +1646,7 @@ static PyObject *_Nuitka_AsyncgenAsend_throw2(PyThreadState *tstate, struct Nuit
|
|
|
1642
1646
|
static PyObject *Nuitka_AsyncgenAsend_close(struct Nuitka_AsyncgenAsendObject *asyncgen_asend, PyObject *args) {
|
|
1643
1647
|
asyncgen_asend->m_state = AWAITABLE_STATE_CLOSED;
|
|
1644
1648
|
|
|
1645
|
-
|
|
1649
|
+
Py_INCREF_IMMORTAL(Py_None);
|
|
1646
1650
|
return Py_None;
|
|
1647
1651
|
}
|
|
1648
1652
|
|
|
@@ -2049,7 +2053,7 @@ static PyObject *Nuitka_AsyncgenAthrow_tp_iternext(struct Nuitka_AsyncgenAthrowO
|
|
|
2049
2053
|
static PyObject *Nuitka_AsyncgenAthrow_close(struct Nuitka_AsyncgenAthrowObject *asyncgen_athrow) {
|
|
2050
2054
|
asyncgen_athrow->m_state = AWAITABLE_STATE_CLOSED;
|
|
2051
2055
|
|
|
2052
|
-
|
|
2056
|
+
Py_INCREF_IMMORTAL(Py_None);
|
|
2053
2057
|
return Py_None;
|
|
2054
2058
|
}
|
|
2055
2059
|
|
|
@@ -2180,6 +2184,13 @@ static void _initCompiledAsyncgenTypes(void) {
|
|
|
2180
2184
|
Nuitka_PyType_Ready(&Nuitka_AsyncgenAsend_Type, NULL, true, false, true, true, false);
|
|
2181
2185
|
Nuitka_PyType_Ready(&Nuitka_AsyncgenAthrow_Type, NULL, true, false, true, true, false);
|
|
2182
2186
|
Nuitka_PyType_Ready(&Nuitka_AsyncgenValueWrapper_Type, NULL, false, false, false, false, false);
|
|
2187
|
+
|
|
2188
|
+
#if PYTHON_VERSION >= 0x3d0
|
|
2189
|
+
PyThreadState *tstate = PyThreadState_GET();
|
|
2190
|
+
PyObject *asyncgen_wrapper_object = _PyIntrinsics_UnaryFunctions[INTRINSIC_ASYNC_GEN_WRAP].func(tstate, Py_None);
|
|
2191
|
+
Nuitka_PyAsyncGenWrappedValue_Type = Py_TYPE(asyncgen_wrapper_object);
|
|
2192
|
+
Py_DECREF(asyncgen_wrapper_object);
|
|
2193
|
+
#endif
|
|
2183
2194
|
}
|
|
2184
2195
|
|
|
2185
2196
|
// Part of "Nuitka", an optimizing Python compiler that is compatible and
|
|
@@ -30,7 +30,7 @@ static void _initBuiltinTypeMethods(void) {
|
|
|
30
30
|
_initListBuiltinMethods();
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
#if PYTHON_VERSION >=
|
|
33
|
+
#if PYTHON_VERSION >= 0x350
|
|
34
34
|
#include "HelpersAllocator.c"
|
|
35
35
|
#endif
|
|
36
36
|
|
|
@@ -81,7 +81,7 @@ static PyObject *_BUILTIN_RANGE_INT3(long low, long high, long step) {
|
|
|
81
81
|
size = ESTIMATE_RANGE(high, low, -step);
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
PyObject *result = MAKE_LIST_EMPTY(size);
|
|
84
|
+
PyObject *result = MAKE_LIST_EMPTY(tstate, size);
|
|
85
85
|
|
|
86
86
|
long current = low;
|
|
87
87
|
|
|
@@ -96,7 +96,7 @@ static PyObject *_BUILTIN_RANGE_INT3(long low, long high, long step) {
|
|
|
96
96
|
static PyObject *_BUILTIN_RANGE_INT2(long low, long high) { return _BUILTIN_RANGE_INT3(low, high, 1); }
|
|
97
97
|
|
|
98
98
|
static PyObject *_BUILTIN_RANGE_INT(long boundary) {
|
|
99
|
-
PyObject *result = MAKE_LIST_EMPTY(boundary > 0 ? boundary : 0);
|
|
99
|
+
PyObject *result = MAKE_LIST_EMPTY(tstate, boundary > 0 ? boundary : 0);
|
|
100
100
|
|
|
101
101
|
for (int i = 0; i < boundary; i++) {
|
|
102
102
|
PyList_SET_ITEM(result, i, PyInt_FromLong(i));
|
|
@@ -191,7 +191,7 @@ PyObject *BUILTIN_RANGE2(PyThreadState *tstate, PyObject *low, PyObject *high) {
|
|
|
191
191
|
|
|
192
192
|
if (fallback) {
|
|
193
193
|
// Transfers references to tuple.
|
|
194
|
-
PyObject *pos_args = MAKE_TUPLE2_0(low_temp, high_temp);
|
|
194
|
+
PyObject *pos_args = MAKE_TUPLE2_0(tstate, low_temp, high_temp);
|
|
195
195
|
NUITKA_ASSIGN_BUILTIN(range);
|
|
196
196
|
|
|
197
197
|
PyObject *result = CALL_FUNCTION_WITH_POSARGS2(tstate, NUITKA_ACCESS_BUILTIN(range), pos_args);
|
|
@@ -250,7 +250,7 @@ PyObject *BUILTIN_RANGE3(PyThreadState *tstate, PyObject *low, PyObject *high, P
|
|
|
250
250
|
}
|
|
251
251
|
|
|
252
252
|
if (fallback) {
|
|
253
|
-
PyObject *pos_args = MAKE_TUPLE3_0(low_temp, high_temp, step_temp);
|
|
253
|
+
PyObject *pos_args = MAKE_TUPLE3_0(tstate, low_temp, high_temp, step_temp);
|
|
254
254
|
|
|
255
255
|
NUITKA_ASSIGN_BUILTIN(range);
|
|
256
256
|
|
|
@@ -585,7 +585,7 @@ PyObject *BUILTIN_ALL(PyThreadState *tstate, PyObject *value) {
|
|
|
585
585
|
|
|
586
586
|
if (cmp == 0) {
|
|
587
587
|
Py_DECREF(it);
|
|
588
|
-
|
|
588
|
+
Py_INCREF_IMMORTAL(Py_False);
|
|
589
589
|
return Py_False;
|
|
590
590
|
}
|
|
591
591
|
}
|
|
@@ -596,7 +596,7 @@ PyObject *BUILTIN_ALL(PyThreadState *tstate, PyObject *value) {
|
|
|
596
596
|
return NULL;
|
|
597
597
|
}
|
|
598
598
|
|
|
599
|
-
|
|
599
|
+
Py_INCREF_IMMORTAL(Py_True);
|
|
600
600
|
return Py_True;
|
|
601
601
|
}
|
|
602
602
|
|
|
@@ -635,7 +635,7 @@ PyObject *BUILTIN_ANY(PyThreadState *tstate, PyObject *value) {
|
|
|
635
635
|
}
|
|
636
636
|
if (cmp > 0) {
|
|
637
637
|
Py_DECREF(it);
|
|
638
|
-
|
|
638
|
+
Py_INCREF_IMMORTAL(Py_True);
|
|
639
639
|
return Py_True;
|
|
640
640
|
}
|
|
641
641
|
}
|
|
@@ -645,7 +645,7 @@ PyObject *BUILTIN_ANY(PyThreadState *tstate, PyObject *value) {
|
|
|
645
645
|
return NULL;
|
|
646
646
|
}
|
|
647
647
|
|
|
648
|
-
|
|
648
|
+
Py_INCREF_IMMORTAL(Py_False);
|
|
649
649
|
return Py_False;
|
|
650
650
|
}
|
|
651
651
|
|
|
@@ -808,7 +808,7 @@ bool PRINT_ITEM_TO(PyObject *file, PyObject *object) {
|
|
|
808
808
|
FETCH_ERROR_OCCURRED_STATE_UNTRACED(tstate, &saved_exception_state);
|
|
809
809
|
|
|
810
810
|
// TODO: Have a helper that creates a dictionary for PyObject **
|
|
811
|
-
PyObject *print_kw = MAKE_DICT_EMPTY();
|
|
811
|
+
PyObject *print_kw = MAKE_DICT_EMPTY(tstate);
|
|
812
812
|
DICT_SET_ITEM(print_kw, const_str_plain_end, const_str_empty);
|
|
813
813
|
|
|
814
814
|
if (file == NULL) {
|
|
@@ -817,7 +817,7 @@ bool PRINT_ITEM_TO(PyObject *file, PyObject *object) {
|
|
|
817
817
|
DICT_SET_ITEM(print_kw, const_str_plain_file, file);
|
|
818
818
|
}
|
|
819
819
|
|
|
820
|
-
PyObject *print_args = MAKE_TUPLE1(object);
|
|
820
|
+
PyObject *print_args = MAKE_TUPLE1(tstate, object);
|
|
821
821
|
|
|
822
822
|
PyObject *result = CALL_FUNCTION(tstate, NUITKA_ACCESS_BUILTIN(print), print_args, print_kw);
|
|
823
823
|
|
|
@@ -967,7 +967,7 @@ void PRINT_TRACEBACK(PyTracebackObject *traceback) {
|
|
|
967
967
|
PyFrameObject *frame = traceback->tb_frame;
|
|
968
968
|
|
|
969
969
|
while (frame != NULL) {
|
|
970
|
-
printf(" Frame at %s\n", PyString_AsString(PyObject_Str((PyObject *)frame
|
|
970
|
+
printf(" Frame at %s\n", PyString_AsString(PyObject_Str((PyObject *)Nuitka_Frame_GetCodeObject(frame))));
|
|
971
971
|
|
|
972
972
|
frame = frame->f_back;
|
|
973
973
|
}
|
|
@@ -1160,7 +1160,7 @@ static PyObject *nuitka_class_getattr(PyClassObject *klass, PyObject *attr_name)
|
|
|
1160
1160
|
return klass->cl_bases;
|
|
1161
1161
|
} else if (strcmp(sattr_name, "__name__") == 0) {
|
|
1162
1162
|
if (klass->cl_name == NULL) {
|
|
1163
|
-
|
|
1163
|
+
Py_INCREF_IMMORTAL(Py_None);
|
|
1164
1164
|
return Py_None;
|
|
1165
1165
|
} else {
|
|
1166
1166
|
Py_INCREF(klass->cl_name);
|
|
@@ -1382,7 +1382,7 @@ PyObject *BUILTIN_SUM1(PyThreadState *tstate, PyObject *sequence) {
|
|
|
1382
1382
|
#endif
|
|
1383
1383
|
|
|
1384
1384
|
if (item == Py_False) {
|
|
1385
|
-
|
|
1385
|
+
Py_DECREF_IMMORTAL(item);
|
|
1386
1386
|
continue;
|
|
1387
1387
|
}
|
|
1388
1388
|
|
|
@@ -1459,7 +1459,7 @@ PyObject *BUILTIN_SUM2(PyThreadState *tstate, PyObject *sequence, PyObject *star
|
|
|
1459
1459
|
CHECK_OBJECT(sequence);
|
|
1460
1460
|
CHECK_OBJECT(start);
|
|
1461
1461
|
|
|
1462
|
-
PyObject *pos_args = MAKE_TUPLE2(sequence, start);
|
|
1462
|
+
PyObject *pos_args = MAKE_TUPLE2(tstate, sequence, start);
|
|
1463
1463
|
|
|
1464
1464
|
PyObject *result = CALL_FUNCTION_WITH_POSARGS2(tstate, NUITKA_ACCESS_BUILTIN(sum), pos_args);
|
|
1465
1465
|
|
|
@@ -2002,7 +2002,9 @@ volatile int _Py_Ticker = _Py_CheckInterval;
|
|
|
2002
2002
|
iternextfunc default_iternext;
|
|
2003
2003
|
|
|
2004
2004
|
void _initSlotIterNext(void) {
|
|
2005
|
-
|
|
2005
|
+
PyThreadState *tstate = PyThreadState_GET();
|
|
2006
|
+
|
|
2007
|
+
PyObject *pos_args = MAKE_TUPLE1(tstate, (PyObject *)&PyBaseObject_Type);
|
|
2006
2008
|
|
|
2007
2009
|
// Note: Not using MAKE_DICT_EMPTY on purpose, this is called early on.
|
|
2008
2010
|
PyObject *kw_args = PyDict_New();
|
|
@@ -124,7 +124,7 @@ static PyObject *Nuitka_Coroutine_get_cr_await(struct Nuitka_CoroutineObject *co
|
|
|
124
124
|
Py_INCREF(coroutine->m_yield_from);
|
|
125
125
|
return coroutine->m_yield_from;
|
|
126
126
|
} else {
|
|
127
|
-
|
|
127
|
+
Py_INCREF_IMMORTAL(Py_None);
|
|
128
128
|
return Py_None;
|
|
129
129
|
}
|
|
130
130
|
}
|
|
@@ -154,7 +154,7 @@ static PyObject *Nuitka_Coroutine_get_frame(struct Nuitka_CoroutineObject *corou
|
|
|
154
154
|
Py_INCREF(coroutine->m_frame);
|
|
155
155
|
return (PyObject *)coroutine->m_frame;
|
|
156
156
|
} else {
|
|
157
|
-
|
|
157
|
+
Py_INCREF_IMMORTAL(Py_None);
|
|
158
158
|
return Py_None;
|
|
159
159
|
}
|
|
160
160
|
}
|
|
@@ -222,7 +222,7 @@ static PyObject *_Nuitka_YieldFromCore(PyThreadState *tstate, PyObject *yield_fr
|
|
|
222
222
|
struct Nuitka_CoroutineObject *yieldfrom_coroutine =
|
|
223
223
|
((struct Nuitka_CoroutineWrapperObject *)yield_from)->m_coroutine;
|
|
224
224
|
|
|
225
|
-
|
|
225
|
+
Py_INCREF_IMMORTAL(Py_None);
|
|
226
226
|
|
|
227
227
|
struct Nuitka_ExceptionPreservationItem no_exception_state;
|
|
228
228
|
INIT_ERROR_OCCURRED_STATE(&no_exception_state);
|
|
@@ -245,7 +245,7 @@ static PyObject *_Nuitka_YieldFromCore(PyThreadState *tstate, PyObject *yield_fr
|
|
|
245
245
|
PyObject *error = GET_ERROR_OCCURRED(tstate);
|
|
246
246
|
|
|
247
247
|
if (error == NULL) {
|
|
248
|
-
|
|
248
|
+
Py_INCREF_IMMORTAL(Py_None);
|
|
249
249
|
*returned_value = Py_None;
|
|
250
250
|
} else if (likely(EXCEPTION_MATCH_BOOL_SINGLE(tstate, error, PyExc_StopIteration))) {
|
|
251
251
|
// The sub-generator has given an exception. In case of
|
|
@@ -593,9 +593,7 @@ static PyObject *_Nuitka_Coroutine_send(PyThreadState *tstate, struct Nuitka_Cor
|
|
|
593
593
|
|
|
594
594
|
switch (res) {
|
|
595
595
|
case PYGEN_RETURN:
|
|
596
|
-
if (result
|
|
597
|
-
SET_CURRENT_EXCEPTION_TYPE0(tstate, PyExc_StopIteration);
|
|
598
|
-
} else {
|
|
596
|
+
if (result != NULL) {
|
|
599
597
|
if (result != Py_None) {
|
|
600
598
|
Nuitka_SetStopIterationValue(tstate, result);
|
|
601
599
|
}
|
|
@@ -670,7 +668,7 @@ static PyObject *Nuitka_Coroutine_close(struct Nuitka_CoroutineObject *coroutine
|
|
|
670
668
|
if (unlikely(r == false)) {
|
|
671
669
|
return NULL;
|
|
672
670
|
} else {
|
|
673
|
-
|
|
671
|
+
Py_INCREF_IMMORTAL(Py_None);
|
|
674
672
|
return Py_None;
|
|
675
673
|
}
|
|
676
674
|
}
|
|
@@ -1353,12 +1351,15 @@ static int Nuitka_PyInterpreterFrame_GetLine(_PyInterpreterFrame *frame) {
|
|
|
1353
1351
|
// we have the line number stored.
|
|
1354
1352
|
|
|
1355
1353
|
int addr = _PyInterpreterFrame_LASTI(frame) * sizeof(_Py_CODEUNIT);
|
|
1354
|
+
#if PYTHON_VERSION < 0x3d0
|
|
1356
1355
|
return PyCode_Addr2Line(frame->f_code, addr);
|
|
1356
|
+
#else
|
|
1357
|
+
return PyCode_Addr2Line((PyCodeObject *)frame->f_executable, addr);
|
|
1358
|
+
#endif
|
|
1357
1359
|
}
|
|
1358
1360
|
|
|
1359
|
-
static PyObject *computeCoroutineOrigin(int origin_depth) {
|
|
1360
|
-
|
|
1361
|
-
_PyInterpreterFrame *current_frame = tstate->cframe->current_frame;
|
|
1361
|
+
static PyObject *computeCoroutineOrigin(PyThreadState *tstate, int origin_depth) {
|
|
1362
|
+
_PyInterpreterFrame *current_frame = CURRENT_TSTATE_INTERPRETER_FRAME(tstate);
|
|
1362
1363
|
|
|
1363
1364
|
// Create result tuple with correct size.
|
|
1364
1365
|
int frame_count = 0;
|
|
@@ -1367,11 +1368,11 @@ static PyObject *computeCoroutineOrigin(int origin_depth) {
|
|
|
1367
1368
|
frame = frame->previous;
|
|
1368
1369
|
frame_count += 1;
|
|
1369
1370
|
}
|
|
1370
|
-
PyObject *cr_origin = MAKE_TUPLE_EMPTY_VAR(frame_count);
|
|
1371
|
+
PyObject *cr_origin = MAKE_TUPLE_EMPTY_VAR(tstate, frame_count);
|
|
1371
1372
|
|
|
1372
1373
|
frame = current_frame;
|
|
1373
1374
|
for (int i = 0; i < frame_count; i++) {
|
|
1374
|
-
PyCodeObject *code = frame
|
|
1375
|
+
PyCodeObject *code = Nuitka_InterpreterFrame_GetCodeObject(frame);
|
|
1375
1376
|
|
|
1376
1377
|
int line = Nuitka_PyInterpreterFrame_GetLine(frame);
|
|
1377
1378
|
|
|
@@ -1386,7 +1387,7 @@ static PyObject *computeCoroutineOrigin(int origin_depth) {
|
|
|
1386
1387
|
}
|
|
1387
1388
|
|
|
1388
1389
|
#elif PYTHON_VERSION >= 0x370
|
|
1389
|
-
static PyObject *computeCoroutineOrigin(int origin_depth) {
|
|
1390
|
+
static PyObject *computeCoroutineOrigin(PyThreadState *tstate, int origin_depth) {
|
|
1390
1391
|
PyFrameObject *frame = PyEval_GetFrame();
|
|
1391
1392
|
|
|
1392
1393
|
int frame_count = 0;
|
|
@@ -1396,13 +1397,13 @@ static PyObject *computeCoroutineOrigin(int origin_depth) {
|
|
|
1396
1397
|
frame_count += 1;
|
|
1397
1398
|
}
|
|
1398
1399
|
|
|
1399
|
-
PyObject *cr_origin = MAKE_TUPLE_EMPTY(frame_count);
|
|
1400
|
+
PyObject *cr_origin = MAKE_TUPLE_EMPTY(tstate, frame_count);
|
|
1400
1401
|
|
|
1401
1402
|
frame = PyEval_GetFrame();
|
|
1402
1403
|
|
|
1403
1404
|
for (int i = 0; i < frame_count; i++) {
|
|
1404
|
-
PyObject *frame_info =
|
|
1405
|
-
|
|
1405
|
+
PyObject *frame_info = Py_BuildValue("OiO", Nuitka_Frame_GetCodeObject(frame)->co_filename,
|
|
1406
|
+
PyFrame_GetLineNumber(frame), frame->f_code->co_name);
|
|
1406
1407
|
|
|
1407
1408
|
assert(frame_info);
|
|
1408
1409
|
|
|
@@ -1478,7 +1479,7 @@ PyObject *Nuitka_Coroutine_New(PyThreadState *tstate, coroutine_code code, PyObj
|
|
|
1478
1479
|
if (origin_depth == 0) {
|
|
1479
1480
|
result->m_origin = NULL;
|
|
1480
1481
|
} else {
|
|
1481
|
-
result->m_origin = computeCoroutineOrigin(origin_depth);
|
|
1482
|
+
result->m_origin = computeCoroutineOrigin(tstate, origin_depth);
|
|
1482
1483
|
}
|
|
1483
1484
|
#endif
|
|
1484
1485
|
|
|
@@ -1496,9 +1497,12 @@ PyObject *Nuitka_Coroutine_New(PyThreadState *tstate, coroutine_code code, PyObj
|
|
|
1496
1497
|
static inline PyCodeObject *_Nuitka_PyGen_GetCode(PyGenObject *gen) {
|
|
1497
1498
|
#if PYTHON_VERSION < 0x3c0
|
|
1498
1499
|
return (PyCodeObject *)gen->gi_code;
|
|
1499
|
-
#
|
|
1500
|
+
#elif PYTHON_VERSION < 0x3d0
|
|
1500
1501
|
_PyInterpreterFrame *frame = (_PyInterpreterFrame *)(gen->gi_iframe);
|
|
1501
1502
|
return frame->f_code;
|
|
1503
|
+
#else
|
|
1504
|
+
_PyInterpreterFrame *frame = (_PyInterpreterFrame *)(gen->gi_iframe);
|
|
1505
|
+
return (PyCodeObject *)frame->f_executable;
|
|
1502
1506
|
#endif
|
|
1503
1507
|
}
|
|
1504
1508
|
|