Nuitka-winsvc 2.3.11__cp311-cp311-win_amd64.whl → 2.4.5__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.3.11.data/scripts/nuitka-run.bat → Nuitka_winsvc-2.4.5.data/scripts/nuitka-run.cmd +1 -1
- {Nuitka_winsvc-2.3.11.dist-info → Nuitka_winsvc-2.4.5.dist-info}/METADATA +1 -1
- {Nuitka_winsvc-2.3.11.dist-info → Nuitka_winsvc-2.4.5.dist-info}/RECORD +213 -210
- {Nuitka_winsvc-2.3.11.dist-info → Nuitka_winsvc-2.4.5.dist-info}/WHEEL +1 -1
- nuitka/CacheCleanup.py +6 -1
- nuitka/HardImportRegistry.py +30 -2
- nuitka/MainControl.py +62 -35
- nuitka/ModuleRegistry.py +11 -3
- nuitka/OptionParsing.py +78 -39
- nuitka/Options.py +142 -35
- nuitka/OutputDirectories.py +5 -0
- nuitka/PostProcessing.py +23 -14
- nuitka/Progress.py +2 -1
- nuitka/PythonFlavors.py +22 -4
- nuitka/PythonVersions.py +18 -0
- nuitka/Tracing.py +1 -0
- nuitka/TreeXML.py +6 -3
- nuitka/Version.py +1 -1
- nuitka/__main__.py +55 -10
- nuitka/__past__.py +5 -0
- nuitka/build/Backend.scons +6 -1
- nuitka/build/CCompilerVersion.scons +1 -0
- nuitka/build/Onefile.scons +4 -0
- nuitka/build/SconsCaching.py +2 -1
- nuitka/build/SconsCompilerSettings.py +1 -0
- nuitka/build/SconsHacks.py +5 -1
- nuitka/build/SconsInterface.py +2 -0
- nuitka/build/SconsUtils.py +4 -1
- nuitka/build/include/nuitka/allocator.h +27 -5
- nuitka/build/include/nuitka/calling.h +1 -1
- nuitka/build/include/nuitka/compiled_frame.h +23 -23
- nuitka/build/include/nuitka/compiled_method.h +1 -1
- nuitka/build/include/nuitka/exception_groups.h +0 -2
- nuitka/build/include/nuitka/helper/attributes.h +7 -1
- nuitka/build/include/nuitka/helper/subscripts.h +1 -1
- nuitka/build/include/nuitka/helpers.h +10 -3
- nuitka/build/include/nuitka/prelude.h +6 -15
- nuitka/build/include/nuitka/printing.h +2 -0
- nuitka/build/include/nuitka/unfreezing.h +11 -5
- nuitka/build/inline_copy/tqdm/tqdm/_monitor.py +4 -1
- nuitka/build/static_src/CompiledAsyncgenType.c +2 -4
- nuitka/build/static_src/CompiledCellType.c +7 -7
- nuitka/build/static_src/CompiledCodeHelpers.c +49 -36
- nuitka/build/static_src/CompiledCoroutineType.c +2 -4
- nuitka/build/static_src/CompiledFrameType.c +109 -82
- nuitka/build/static_src/CompiledFunctionType.c +36 -9
- nuitka/build/static_src/CompiledGeneratorType.c +12 -10
- nuitka/build/static_src/CompiledGeneratorTypeUncompiledIntegration.c +2 -2
- nuitka/build/static_src/CompiledMethodType.c +14 -13
- nuitka/build/static_src/HelpersAttributes.c +13 -15
- nuitka/build/static_src/HelpersBuiltin.c +16 -7
- nuitka/build/static_src/HelpersCalling.c +13 -13
- nuitka/build/static_src/HelpersCallingGenerated.c +22 -22
- nuitka/build/static_src/HelpersComparisonEq.c +110 -110
- nuitka/build/static_src/HelpersComparisonEqUtils.c +1 -1
- nuitka/build/static_src/HelpersComparisonGe.c +110 -110
- nuitka/build/static_src/HelpersComparisonGt.c +110 -110
- nuitka/build/static_src/HelpersComparisonLe.c +110 -110
- nuitka/build/static_src/HelpersComparisonLt.c +110 -110
- nuitka/build/static_src/HelpersComparisonNe.c +110 -110
- nuitka/build/static_src/HelpersConstantsBlob.c +480 -481
- nuitka/build/static_src/HelpersDictionaries.c +9 -0
- nuitka/build/static_src/HelpersFilesystemPaths.c +28 -13
- nuitka/build/static_src/HelpersImport.c +1 -1
- nuitka/build/static_src/HelpersLists.c +5 -1
- nuitka/build/static_src/HelpersMatching.c +95 -35
- nuitka/build/static_src/HelpersOperationInplaceAdd.c +23 -23
- nuitka/build/static_src/HelpersOperationInplaceAddUtils.c +1 -0
- nuitka/build/static_src/HelpersOperationInplaceBitand.c +11 -11
- nuitka/build/static_src/HelpersOperationInplaceBitor.c +11 -11
- nuitka/build/static_src/HelpersOperationInplaceBitxor.c +11 -11
- nuitka/build/static_src/HelpersOperationInplaceFloordiv.c +17 -17
- nuitka/build/static_src/HelpersOperationInplaceLshift.c +9 -9
- nuitka/build/static_src/HelpersOperationInplaceMatmult.c +10 -10
- nuitka/build/static_src/HelpersOperationInplaceMod.c +47 -47
- nuitka/build/static_src/HelpersOperationInplaceMult.c +28 -28
- nuitka/build/static_src/HelpersOperationInplaceOlddiv.c +17 -17
- nuitka/build/static_src/HelpersOperationInplacePow.c +17 -17
- nuitka/build/static_src/HelpersOperationInplaceRshift.c +9 -9
- nuitka/build/static_src/HelpersOperationInplaceSub.c +17 -17
- nuitka/build/static_src/HelpersOperationInplaceTruediv.c +17 -17
- nuitka/build/static_src/HelpersSequences.c +1 -1
- nuitka/build/static_src/HelpersTypes.c +8 -4
- nuitka/build/static_src/InspectPatcher.c +14 -2
- nuitka/build/static_src/MainProgram.c +20 -1
- nuitka/build/static_src/MetaPathBasedLoader.c +163 -140
- nuitka/build/static_src/MetaPathBasedLoaderImportlibMetadataDistribution.c +13 -4
- nuitka/build/static_src/OnefileBootstrap.c +100 -6
- nuitka/code_generation/AttributeCodes.py +12 -10
- nuitka/code_generation/CodeGeneration.py +6 -7
- nuitka/code_generation/ConstantCodes.py +53 -10
- nuitka/code_generation/Emission.py +1 -1
- nuitka/code_generation/GlobalConstants.py +6 -6
- nuitka/code_generation/Indentation.py +4 -5
- nuitka/code_generation/LoaderCodes.py +3 -0
- nuitka/code_generation/LocalsDictCodes.py +36 -14
- nuitka/code_generation/MatchCodes.py +23 -4
- nuitka/code_generation/ModuleCodes.py +1 -8
- nuitka/code_generation/Namify.py +2 -0
- nuitka/code_generation/PackageResourceCodes.py +5 -1
- nuitka/code_generation/templates/CodeTemplatesConstants.py +22 -4
- nuitka/code_generation/templates/CodeTemplatesLoader.py +1 -1
- nuitka/code_generation/templates/CodeTemplatesModules.py +27 -9
- nuitka/code_generation/templates/CodeTemplatesVariables.py +16 -2
- nuitka/code_generation/templates_c/CodeTemplateCallsMethodPositional.c.j2 +2 -2
- nuitka/code_generation/templates_c/HelperOperationBinary.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperOperationInplace.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperSlotsBinary.c.j2 +7 -7
- nuitka/freezer/DependsExe.py +3 -1
- nuitka/freezer/DllDependenciesMacOS.py +5 -12
- nuitka/freezer/IncludedDataFiles.py +15 -4
- nuitka/freezer/IncludedEntryPoints.py +8 -2
- nuitka/freezer/Onefile.py +6 -1
- nuitka/freezer/Standalone.py +9 -2
- nuitka/importing/Importing.py +14 -5
- nuitka/importing/Recursion.py +3 -0
- nuitka/nodes/AttributeNodesGenerated.py +21 -12
- nuitka/nodes/BuiltinOpenNodes.py +5 -0
- nuitka/nodes/BuiltinOperationNodeBasesGenerated.py +11 -11
- nuitka/nodes/BuiltinRefNodes.py +41 -1
- nuitka/nodes/ChildrenHavingMixins.py +143 -355
- nuitka/nodes/ClassNodes.py +30 -12
- nuitka/nodes/CodeObjectSpecs.py +9 -0
- nuitka/nodes/ExpressionBasesGenerated.py +11 -11
- nuitka/nodes/FunctionNodes.py +7 -11
- nuitka/nodes/FutureSpecs.py +16 -3
- nuitka/nodes/GeneratorNodes.py +2 -2
- nuitka/nodes/HardImportNodesGenerated.py +11 -134
- nuitka/nodes/LocalsScopes.py +19 -23
- nuitka/nodes/MatchNodes.py +18 -7
- nuitka/nodes/ModuleAttributeNodes.py +1 -20
- nuitka/nodes/ModuleNodes.py +23 -6
- nuitka/nodes/NodeBases.py +3 -2
- nuitka/nodes/NodeMetaClasses.py +26 -10
- nuitka/nodes/ReturnNodes.py +1 -1
- nuitka/nodes/StatementBasesGenerated.py +11 -11
- nuitka/nodes/SubscriptNodes.py +4 -4
- nuitka/nodes/VariableAssignNodes.py +1 -1
- nuitka/nodes/VariableRefNodes.py +28 -2
- nuitka/optimizations/FunctionInlining.py +3 -6
- nuitka/optimizations/Optimization.py +13 -12
- nuitka/optimizations/TraceCollections.py +19 -4
- nuitka/plugins/PluginBase.py +121 -133
- nuitka/plugins/Plugins.py +92 -4
- nuitka/plugins/YamlPluginBase.py +121 -0
- nuitka/plugins/standard/AntiBloatPlugin.py +87 -28
- nuitka/plugins/standard/DataFilesPlugin.py +15 -6
- nuitka/plugins/standard/DelvewheelPlugin.py +7 -3
- nuitka/plugins/standard/DllFilesPlugin.py +5 -3
- nuitka/plugins/standard/ImplicitImports.py +34 -20
- nuitka/plugins/standard/MatplotlibPlugin.py +3 -1
- nuitka/plugins/standard/MultiprocessingPlugin.py +2 -2
- nuitka/plugins/standard/OptionsNannyPlugin.py +1 -1
- nuitka/plugins/standard/PySidePyQtPlugin.py +11 -12
- nuitka/plugins/standard/SpacyPlugin.py +136 -0
- nuitka/plugins/standard/standard.nuitka-package.config.yml +489 -182
- nuitka/plugins/standard/stdlib3.nuitka-package.config.yml +6 -0
- nuitka/reports/Reports.py +53 -5
- nuitka/specs/BuiltinParameterSpecs.py +1 -1
- nuitka/specs/HardImportSpecs.py +0 -6
- nuitka/tools/data_composer/DataComposer.py +29 -27
- nuitka/tools/environments/CreateEnvironment.py +1 -0
- nuitka/tools/environments/Virtualenv.py +25 -11
- nuitka/tools/general/find_module/FindModuleCode.py +13 -3
- nuitka/tools/onefile_compressor/OnefileCompressor.py +21 -4
- nuitka/tools/scanning/DisplayPackageDLLs.py +17 -3
- nuitka/tools/specialize/CTypeDescriptions.py +13 -7
- nuitka/tools/specialize/SpecializePython.py +18 -1
- nuitka/tools/testing/Common.py +19 -6
- nuitka/tools/testing/check_reference_counts/__main__.py +1 -1
- nuitka/tools/testing/run_nuitka_tests/__main__.py +0 -20
- nuitka/tools/watch/AutoStage.py +144 -0
- nuitka/tools/watch/__main__.py +79 -32
- nuitka/tree/Building.py +105 -104
- nuitka/tree/ComplexCallHelperFunctions.py +16 -26
- nuitka/tree/InternalModule.py +8 -0
- nuitka/tree/ReformulationAssignmentStatements.py +29 -59
- nuitka/tree/ReformulationClasses.py +10 -17
- nuitka/tree/ReformulationClasses3.py +69 -43
- nuitka/tree/ReformulationComparisonExpressions.py +6 -16
- nuitka/tree/ReformulationContractionExpressions.py +14 -23
- nuitka/tree/ReformulationDictionaryCreation.py +6 -10
- nuitka/tree/ReformulationExecStatements.py +10 -10
- nuitka/tree/ReformulationForLoopStatements.py +6 -12
- nuitka/tree/ReformulationFunctionStatements.py +21 -28
- nuitka/tree/ReformulationImportStatements.py +8 -10
- nuitka/tree/ReformulationLambdaExpressions.py +3 -6
- nuitka/tree/ReformulationMatchStatements.py +166 -60
- nuitka/tree/ReformulationMultidist.py +3 -1
- nuitka/tree/ReformulationNamespacePackages.py +1 -1
- nuitka/tree/ReformulationPrintStatements.py +3 -6
- nuitka/tree/ReformulationSequenceCreation.py +13 -26
- nuitka/tree/ReformulationTryFinallyStatements.py +15 -0
- nuitka/tree/ReformulationWithStatements.py +12 -16
- nuitka/tree/SourceHandling.py +13 -8
- nuitka/tree/VariableClosure.py +5 -21
- nuitka/utils/Distributions.py +80 -11
- nuitka/utils/Download.py +38 -31
- nuitka/utils/Execution.py +13 -2
- nuitka/utils/FileOperations.py +55 -28
- nuitka/utils/Images.py +6 -1
- nuitka/utils/Importing.py +1 -1
- nuitka/utils/ModuleNames.py +11 -5
- nuitka/utils/ReExecute.py +17 -13
- nuitka/utils/SharedLibraries.py +32 -8
- nuitka/utils/Signing.py +3 -1
- nuitka/utils/StaticLibraries.py +51 -41
- nuitka/utils/Timing.py +1 -1
- nuitka/utils/Utils.py +29 -7
- /Nuitka_winsvc-2.3.11.data/scripts/nuitka.bat → /Nuitka_winsvc-2.4.5.data/scripts/nuitka.cmd +0 -0
- {Nuitka_winsvc-2.3.11.dist-info → Nuitka_winsvc-2.4.5.dist-info}/LICENSE.txt +0 -0
- {Nuitka_winsvc-2.3.11.dist-info → Nuitka_winsvc-2.4.5.dist-info}/entry_points.txt +0 -0
- {Nuitka_winsvc-2.3.11.dist-info → Nuitka_winsvc-2.4.5.dist-info}/top_level.txt +0 -0
|
@@ -182,7 +182,7 @@ static int Nuitka_Cell_set_contents(struct Nuitka_CellObject *cell, PyObject *va
|
|
|
182
182
|
}
|
|
183
183
|
#endif
|
|
184
184
|
|
|
185
|
-
static PyGetSetDef
|
|
185
|
+
static PyGetSetDef Nuitka_Cell_tp_getset[] = {
|
|
186
186
|
#if PYTHON_VERSION < 0x370
|
|
187
187
|
{(char *)"cell_contents", (getter)Nuitka_Cell_get_contents, NULL, NULL},
|
|
188
188
|
#else
|
|
@@ -218,12 +218,12 @@ PyTypeObject Nuitka_Cell_Type = {
|
|
|
218
218
|
#else
|
|
219
219
|
Nuitka_Cell_tp_richcompare, // tp_richcompare
|
|
220
220
|
#endif
|
|
221
|
-
0,
|
|
222
|
-
0,
|
|
223
|
-
0,
|
|
224
|
-
0,
|
|
225
|
-
0,
|
|
226
|
-
|
|
221
|
+
0, // tp_weaklistoffset
|
|
222
|
+
0, // tp_iter
|
|
223
|
+
0, // tp_iternext
|
|
224
|
+
0, // tp_methods
|
|
225
|
+
0, // tp_members
|
|
226
|
+
Nuitka_Cell_tp_getset, // tp_getset
|
|
227
227
|
};
|
|
228
228
|
|
|
229
229
|
void _initCompiledCellType(void) { Nuitka_PyType_Ready(&Nuitka_Cell_Type, NULL, true, false, false, false, false); }
|
|
@@ -674,7 +674,7 @@ PyObject *BUILTIN_FORMAT(PyThreadState *tstate, PyObject *value, PyObject *forma
|
|
|
674
674
|
}
|
|
675
675
|
|
|
676
676
|
// Helper functions for print. Need to play nice with Python softspace
|
|
677
|
-
//
|
|
677
|
+
// behavior.
|
|
678
678
|
|
|
679
679
|
#if PYTHON_VERSION >= 0x300
|
|
680
680
|
NUITKA_DEFINE_BUILTIN(print);
|
|
@@ -860,6 +860,17 @@ bool PRINT_STRING(char const *str) {
|
|
|
860
860
|
}
|
|
861
861
|
}
|
|
862
862
|
|
|
863
|
+
bool PRINT_STRING_W(wchar_t const *str) {
|
|
864
|
+
if (str) {
|
|
865
|
+
PyObject *tmp = NuitkaUnicode_FromWideChar(str, -1);
|
|
866
|
+
bool res = PRINT_ITEM(tmp);
|
|
867
|
+
Py_DECREF(tmp);
|
|
868
|
+
return res;
|
|
869
|
+
} else {
|
|
870
|
+
return PRINT_STRING("<nullstr>");
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
|
|
863
874
|
bool PRINT_FORMAT(char const *fmt, ...) {
|
|
864
875
|
va_list args;
|
|
865
876
|
va_start(args, fmt);
|
|
@@ -1018,6 +1029,8 @@ bool PRINT_ITEM(PyObject *object) {
|
|
|
1018
1029
|
}
|
|
1019
1030
|
}
|
|
1020
1031
|
|
|
1032
|
+
bool PRINT_ITEM_LINE(PyObject *object) { return PRINT_ITEM(object) && PRINT_NEW_LINE(); }
|
|
1033
|
+
|
|
1021
1034
|
#if PYTHON_VERSION < 0x300
|
|
1022
1035
|
|
|
1023
1036
|
static void set_slot(PyObject **slot, PyObject *value) {
|
|
@@ -1027,26 +1040,26 @@ static void set_slot(PyObject **slot, PyObject *value) {
|
|
|
1027
1040
|
Py_XDECREF(temp);
|
|
1028
1041
|
}
|
|
1029
1042
|
|
|
1030
|
-
static void set_attr_slots(PyClassObject *
|
|
1031
|
-
set_slot(&
|
|
1032
|
-
set_slot(&
|
|
1033
|
-
set_slot(&
|
|
1043
|
+
static void set_attr_slots(PyClassObject *class_object) {
|
|
1044
|
+
set_slot(&class_object->cl_getattr, FIND_ATTRIBUTE_IN_CLASS(class_object, const_str_plain___getattr__));
|
|
1045
|
+
set_slot(&class_object->cl_setattr, FIND_ATTRIBUTE_IN_CLASS(class_object, const_str_plain___setattr__));
|
|
1046
|
+
set_slot(&class_object->cl_delattr, FIND_ATTRIBUTE_IN_CLASS(class_object, const_str_plain___delattr__));
|
|
1034
1047
|
}
|
|
1035
1048
|
|
|
1036
|
-
static bool set_dict(PyClassObject *
|
|
1049
|
+
static bool set_dict(PyClassObject *class_object, PyObject *value) {
|
|
1037
1050
|
if (value == NULL || !PyDict_Check(value)) {
|
|
1038
1051
|
PyThreadState *tstate = PyThreadState_GET();
|
|
1039
1052
|
SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, "__dict__ must be a dictionary object");
|
|
1040
1053
|
return false;
|
|
1041
1054
|
} else {
|
|
1042
|
-
set_slot(&
|
|
1043
|
-
set_attr_slots(
|
|
1055
|
+
set_slot(&class_object->cl_dict, value);
|
|
1056
|
+
set_attr_slots(class_object);
|
|
1044
1057
|
|
|
1045
1058
|
return true;
|
|
1046
1059
|
}
|
|
1047
1060
|
}
|
|
1048
1061
|
|
|
1049
|
-
static bool set_bases(PyClassObject *
|
|
1062
|
+
static bool set_bases(PyClassObject *class_object, PyObject *value) {
|
|
1050
1063
|
if (value == NULL || !PyTuple_Check(value)) {
|
|
1051
1064
|
|
|
1052
1065
|
PyThreadState *tstate = PyThreadState_GET();
|
|
@@ -1066,7 +1079,7 @@ static bool set_bases(PyClassObject *klass, PyObject *value) {
|
|
|
1066
1079
|
return false;
|
|
1067
1080
|
}
|
|
1068
1081
|
|
|
1069
|
-
if (unlikely(PyClass_IsSubclass(base, (PyObject *)
|
|
1082
|
+
if (unlikely(PyClass_IsSubclass(base, (PyObject *)class_object))) {
|
|
1070
1083
|
PyThreadState *tstate = PyThreadState_GET();
|
|
1071
1084
|
|
|
1072
1085
|
SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError,
|
|
@@ -1075,14 +1088,14 @@ static bool set_bases(PyClassObject *klass, PyObject *value) {
|
|
|
1075
1088
|
}
|
|
1076
1089
|
}
|
|
1077
1090
|
|
|
1078
|
-
set_slot(&
|
|
1079
|
-
set_attr_slots(
|
|
1091
|
+
set_slot(&class_object->cl_bases, value);
|
|
1092
|
+
set_attr_slots(class_object);
|
|
1080
1093
|
|
|
1081
1094
|
return true;
|
|
1082
1095
|
}
|
|
1083
1096
|
}
|
|
1084
1097
|
|
|
1085
|
-
static bool set_name(PyClassObject *
|
|
1098
|
+
static bool set_name(PyClassObject *class_object, PyObject *value) {
|
|
1086
1099
|
if (value == NULL || !PyDict_Check(value)) {
|
|
1087
1100
|
PyThreadState *tstate = PyThreadState_GET();
|
|
1088
1101
|
|
|
@@ -1097,11 +1110,11 @@ static bool set_name(PyClassObject *klass, PyObject *value) {
|
|
|
1097
1110
|
return false;
|
|
1098
1111
|
}
|
|
1099
1112
|
|
|
1100
|
-
set_slot(&
|
|
1113
|
+
set_slot(&class_object->cl_name, value);
|
|
1101
1114
|
return true;
|
|
1102
1115
|
}
|
|
1103
1116
|
|
|
1104
|
-
static int nuitka_class_setattr(PyClassObject *
|
|
1117
|
+
static int nuitka_class_setattr(PyClassObject *class_object, PyObject *attr_name, PyObject *value) {
|
|
1105
1118
|
char const *sattr_name = PyString_AsString(attr_name);
|
|
1106
1119
|
|
|
1107
1120
|
if (sattr_name[0] == '_' && sattr_name[1] == '_') {
|
|
@@ -1109,72 +1122,72 @@ static int nuitka_class_setattr(PyClassObject *klass, PyObject *attr_name, PyObj
|
|
|
1109
1122
|
|
|
1110
1123
|
if (sattr_name[n - 2] == '_' && sattr_name[n - 1] == '_') {
|
|
1111
1124
|
if (strcmp(sattr_name, "__dict__") == 0) {
|
|
1112
|
-
if (set_dict(
|
|
1125
|
+
if (set_dict(class_object, value) == false) {
|
|
1113
1126
|
return -1;
|
|
1114
1127
|
} else {
|
|
1115
1128
|
return 0;
|
|
1116
1129
|
}
|
|
1117
1130
|
} else if (strcmp(sattr_name, "__bases__") == 0) {
|
|
1118
|
-
if (set_bases(
|
|
1131
|
+
if (set_bases(class_object, value) == false) {
|
|
1119
1132
|
return -1;
|
|
1120
1133
|
} else {
|
|
1121
1134
|
return 0;
|
|
1122
1135
|
}
|
|
1123
1136
|
} else if (strcmp(sattr_name, "__name__") == 0) {
|
|
1124
|
-
if (set_name(
|
|
1137
|
+
if (set_name(class_object, value) == false) {
|
|
1125
1138
|
return -1;
|
|
1126
1139
|
} else {
|
|
1127
1140
|
return 0;
|
|
1128
1141
|
}
|
|
1129
1142
|
} else if (strcmp(sattr_name, "__getattr__") == 0) {
|
|
1130
|
-
set_slot(&
|
|
1143
|
+
set_slot(&class_object->cl_getattr, value);
|
|
1131
1144
|
} else if (strcmp(sattr_name, "__setattr__") == 0) {
|
|
1132
|
-
set_slot(&
|
|
1145
|
+
set_slot(&class_object->cl_setattr, value);
|
|
1133
1146
|
} else if (strcmp(sattr_name, "__delattr__") == 0) {
|
|
1134
|
-
set_slot(&
|
|
1147
|
+
set_slot(&class_object->cl_delattr, value);
|
|
1135
1148
|
}
|
|
1136
1149
|
}
|
|
1137
1150
|
}
|
|
1138
1151
|
|
|
1139
1152
|
if (value == NULL) {
|
|
1140
|
-
int status = DICT_REMOVE_ITEM(
|
|
1153
|
+
int status = DICT_REMOVE_ITEM(class_object->cl_dict, attr_name);
|
|
1141
1154
|
|
|
1142
1155
|
if (status < 0) {
|
|
1143
|
-
PyErr_Format(PyExc_AttributeError, "class %s has no attribute '%s'",
|
|
1144
|
-
sattr_name);
|
|
1156
|
+
PyErr_Format(PyExc_AttributeError, "class %s has no attribute '%s'",
|
|
1157
|
+
PyString_AS_STRING(class_object->cl_name), sattr_name);
|
|
1145
1158
|
}
|
|
1146
1159
|
|
|
1147
1160
|
return status;
|
|
1148
1161
|
} else {
|
|
1149
|
-
return DICT_SET_ITEM(
|
|
1162
|
+
return DICT_SET_ITEM(class_object->cl_dict, attr_name, value) ? 0 : -1;
|
|
1150
1163
|
}
|
|
1151
1164
|
}
|
|
1152
1165
|
|
|
1153
|
-
static PyObject *nuitka_class_getattr(PyClassObject *
|
|
1166
|
+
static PyObject *nuitka_class_getattr(PyClassObject *class_object, PyObject *attr_name) {
|
|
1154
1167
|
char const *sattr_name = PyString_AsString(attr_name);
|
|
1155
1168
|
|
|
1156
1169
|
if (sattr_name[0] == '_' && sattr_name[1] == '_') {
|
|
1157
1170
|
if (strcmp(sattr_name, "__dict__") == 0) {
|
|
1158
|
-
Py_INCREF(
|
|
1159
|
-
return
|
|
1171
|
+
Py_INCREF(class_object->cl_dict);
|
|
1172
|
+
return class_object->cl_dict;
|
|
1160
1173
|
} else if (strcmp(sattr_name, "__bases__") == 0) {
|
|
1161
|
-
Py_INCREF(
|
|
1162
|
-
return
|
|
1174
|
+
Py_INCREF(class_object->cl_bases);
|
|
1175
|
+
return class_object->cl_bases;
|
|
1163
1176
|
} else if (strcmp(sattr_name, "__name__") == 0) {
|
|
1164
|
-
if (
|
|
1177
|
+
if (class_object->cl_name == NULL) {
|
|
1165
1178
|
Py_INCREF_IMMORTAL(Py_None);
|
|
1166
1179
|
return Py_None;
|
|
1167
1180
|
} else {
|
|
1168
|
-
Py_INCREF(
|
|
1169
|
-
return
|
|
1181
|
+
Py_INCREF(class_object->cl_name);
|
|
1182
|
+
return class_object->cl_name;
|
|
1170
1183
|
}
|
|
1171
1184
|
}
|
|
1172
1185
|
}
|
|
1173
1186
|
|
|
1174
|
-
PyObject *value = FIND_ATTRIBUTE_IN_CLASS(
|
|
1187
|
+
PyObject *value = FIND_ATTRIBUTE_IN_CLASS(class_object, attr_name);
|
|
1175
1188
|
|
|
1176
1189
|
if (unlikely(value == NULL)) {
|
|
1177
|
-
PyErr_Format(PyExc_AttributeError, "class %s has no attribute '%s'", PyString_AS_STRING(
|
|
1190
|
+
PyErr_Format(PyExc_AttributeError, "class %s has no attribute '%s'", PyString_AS_STRING(class_object->cl_name),
|
|
1178
1191
|
sattr_name);
|
|
1179
1192
|
return NULL;
|
|
1180
1193
|
}
|
|
@@ -1187,7 +1200,7 @@ static PyObject *nuitka_class_getattr(PyClassObject *klass, PyObject *attr_name)
|
|
|
1187
1200
|
Py_INCREF(value);
|
|
1188
1201
|
return value;
|
|
1189
1202
|
} else {
|
|
1190
|
-
return tp_descr_get(value, (PyObject *)NULL, (PyObject *)
|
|
1203
|
+
return tp_descr_get(value, (PyObject *)NULL, (PyObject *)class_object);
|
|
1191
1204
|
}
|
|
1192
1205
|
}
|
|
1193
1206
|
|
|
@@ -466,8 +466,6 @@ static PySendResult _Nuitka_Coroutine_sendR(PyThreadState *tstate, struct Nuitka
|
|
|
466
466
|
|
|
467
467
|
Nuitka_MarkCoroutineAsNotRunning(coroutine);
|
|
468
468
|
|
|
469
|
-
tstate = PyThreadState_GET();
|
|
470
|
-
|
|
471
469
|
// Remove the back frame from coroutine if it's there.
|
|
472
470
|
if (coroutine->m_frame) {
|
|
473
471
|
// assert(tstate->frame == &coroutine->m_frame->m_frame);
|
|
@@ -1155,7 +1153,7 @@ static PyMethodDef Nuitka_Coroutine_methods[] = {{"send", (PyCFunction)Nuitka_Co
|
|
|
1155
1153
|
|
|
1156
1154
|
// TODO: Set "__doc__" automatically for method clones of compiled types from
|
|
1157
1155
|
// the documentation of built-in original type.
|
|
1158
|
-
static PyGetSetDef
|
|
1156
|
+
static PyGetSetDef Nuitka_Coroutine_tp_getset[] = {
|
|
1159
1157
|
{(char *)"__name__", (getter)Nuitka_Coroutine_get_name, (setter)Nuitka_Coroutine_set_name, NULL},
|
|
1160
1158
|
{(char *)"__qualname__", (getter)Nuitka_Coroutine_get_qualname, (setter)Nuitka_Coroutine_set_qualname, NULL},
|
|
1161
1159
|
{(char *)"cr_await", (getter)Nuitka_Coroutine_get_cr_await, (setter)NULL, NULL},
|
|
@@ -1212,7 +1210,7 @@ PyTypeObject Nuitka_Coroutine_Type = {
|
|
|
1212
1210
|
0, // tp_iternext
|
|
1213
1211
|
Nuitka_Coroutine_methods, // tp_methods
|
|
1214
1212
|
Nuitka_Coroutine_members, // tp_members
|
|
1215
|
-
|
|
1213
|
+
Nuitka_Coroutine_tp_getset, // tp_getset
|
|
1216
1214
|
0, // tp_base
|
|
1217
1215
|
0, // tp_dict
|
|
1218
1216
|
0, // tp_descr_get
|