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
|
@@ -574,6 +574,15 @@ int DICT_HAS_ITEM(PyThreadState *tstate, PyObject *dict, PyObject *key) {
|
|
|
574
574
|
|
|
575
575
|
return 0;
|
|
576
576
|
}
|
|
577
|
+
|
|
578
|
+
#if PYTHON_VERSION < 0x370 || PYTHON_VERSION >= 0x3b0
|
|
579
|
+
assert(value_addr != NULL);
|
|
580
|
+
PyObject *result = *value_addr;
|
|
581
|
+
#endif
|
|
582
|
+
|
|
583
|
+
if (unlikely(result == NULL)) {
|
|
584
|
+
return 0;
|
|
585
|
+
}
|
|
577
586
|
#endif
|
|
578
587
|
return 1;
|
|
579
588
|
#endif
|
|
@@ -18,7 +18,9 @@
|
|
|
18
18
|
#include <dlfcn.h>
|
|
19
19
|
#include <fcntl.h>
|
|
20
20
|
#include <libgen.h>
|
|
21
|
+
#if !defined(__wasi__)
|
|
21
22
|
#include <pwd.h>
|
|
23
|
+
#endif
|
|
22
24
|
#include <stdlib.h>
|
|
23
25
|
#include <strings.h>
|
|
24
26
|
#include <sys/mman.h>
|
|
@@ -35,7 +37,7 @@
|
|
|
35
37
|
#include "nuitka/safe_string_ops.h"
|
|
36
38
|
|
|
37
39
|
#if defined(__OpenBSD__)
|
|
38
|
-
void _getBinaryPath2(char *
|
|
40
|
+
void _getBinaryPath2(char *binary_filename) {
|
|
39
41
|
int mib[4];
|
|
40
42
|
mib[0] = CTL_KERN;
|
|
41
43
|
mib[1] = KERN_PROC_ARGS;
|
|
@@ -60,7 +62,7 @@ void _getBinaryPath2(char *epath) {
|
|
|
60
62
|
const char *comm = argv[0];
|
|
61
63
|
|
|
62
64
|
if (*comm == '/' || *comm == '.') {
|
|
63
|
-
if (realpath(comm,
|
|
65
|
+
if (realpath(comm, binary_filename) == NULL) {
|
|
64
66
|
abort();
|
|
65
67
|
}
|
|
66
68
|
} else {
|
|
@@ -74,9 +76,9 @@ void _getBinaryPath2(char *epath) {
|
|
|
74
76
|
}
|
|
75
77
|
|
|
76
78
|
while (path) {
|
|
77
|
-
snprintf(
|
|
79
|
+
snprintf(binary_filename, PATH_MAX, "%s/%s", path, comm);
|
|
78
80
|
|
|
79
|
-
if (!stat(
|
|
81
|
+
if (!stat(binary_filename, &st) && (st.st_mode & S_IXUSR)) {
|
|
80
82
|
break;
|
|
81
83
|
}
|
|
82
84
|
|
|
@@ -225,7 +227,7 @@ int64_t getFileSize(FILE_HANDLE file_handle) {
|
|
|
225
227
|
#if defined(__APPLE__)
|
|
226
228
|
#include <copyfile.h>
|
|
227
229
|
#else
|
|
228
|
-
#if defined(__MSYS__) || defined(__HAIKU__) || defined(__OpenBSD__)
|
|
230
|
+
#if defined(__MSYS__) || defined(__HAIKU__) || defined(__OpenBSD__) || defined(__wasi__)
|
|
229
231
|
static bool sendfile(int output_file, int input_file, off_t *bytesCopied, size_t count) {
|
|
230
232
|
char buffer[32768];
|
|
231
233
|
|
|
@@ -435,6 +437,7 @@ static struct MapFileToMemoryInfo mapFileToMemory(filename_char_t const *filenam
|
|
|
435
437
|
result.error = true;
|
|
436
438
|
result.error_code = errno;
|
|
437
439
|
result.erroring_function = "open";
|
|
440
|
+
result.file_size = -1;
|
|
438
441
|
return result;
|
|
439
442
|
}
|
|
440
443
|
|
|
@@ -573,6 +576,9 @@ static void resolveFileSymbolicLink(wchar_t *resolved_filename, wchar_t const *f
|
|
|
573
576
|
|
|
574
577
|
static void resolveFileSymbolicLink(char *resolved_filename, char const *filename, size_t resolved_filename_size,
|
|
575
578
|
bool resolve_symlinks) {
|
|
579
|
+
#ifdef __wasi__
|
|
580
|
+
copyStringSafe(resolved_filename, filename, resolved_filename_size);
|
|
581
|
+
#else
|
|
576
582
|
if (resolve_symlinks) {
|
|
577
583
|
// At least on macOS, realpath cannot allocate a buffer, itself, so lets
|
|
578
584
|
// use a local one, only on Linux we could use NULL argument and have a
|
|
@@ -589,24 +595,27 @@ static void resolveFileSymbolicLink(char *resolved_filename, char const *filenam
|
|
|
589
595
|
} else {
|
|
590
596
|
copyStringSafe(resolved_filename, filename, resolved_filename_size);
|
|
591
597
|
}
|
|
598
|
+
#endif
|
|
592
599
|
}
|
|
593
600
|
#endif
|
|
594
601
|
|
|
595
602
|
#ifdef _WIN32
|
|
596
603
|
wchar_t const *getBinaryFilenameWideChars(bool resolve_symlinks) {
|
|
597
|
-
static wchar_t binary_filename[MAXPATHLEN + 1];
|
|
598
|
-
static
|
|
604
|
+
static wchar_t binary_filename[MAXPATHLEN + 1] = {0};
|
|
605
|
+
static wchar_t binary_filename_resolved[MAXPATHLEN + 1] = {0};
|
|
599
606
|
|
|
600
|
-
|
|
601
|
-
|
|
607
|
+
wchar_t *buffer = resolve_symlinks ? binary_filename : binary_filename_resolved;
|
|
608
|
+
assert(sizeof(binary_filename) == sizeof(binary_filename_resolved));
|
|
609
|
+
|
|
610
|
+
if (buffer[0] == 0) {
|
|
611
|
+
DWORD res = GetModuleFileNameW(NULL, buffer, sizeof(binary_filename) / sizeof(wchar_t));
|
|
602
612
|
assert(res != 0);
|
|
603
613
|
|
|
604
614
|
// Resolve any symlinks we were invoked via
|
|
605
|
-
resolveFileSymbolicLink(
|
|
606
|
-
resolve_symlinks);
|
|
615
|
+
resolveFileSymbolicLink(buffer, buffer, sizeof(binary_filename) / sizeof(wchar_t), resolve_symlinks);
|
|
607
616
|
}
|
|
608
617
|
|
|
609
|
-
return
|
|
618
|
+
return buffer;
|
|
610
619
|
}
|
|
611
620
|
#endif
|
|
612
621
|
|
|
@@ -675,6 +684,9 @@ char const *getBinaryFilenameHostEncoded(bool resolve_symlinks) {
|
|
|
675
684
|
|
|
676
685
|
// Resolve any symlinks we were invoked via
|
|
677
686
|
resolveFileSymbolicLink(binary_filename_target, binary_filename_target, buffer_size, resolve_symlinks);
|
|
687
|
+
#elif defined(__wasi__)
|
|
688
|
+
const char *wasi_filename = "program.wasm";
|
|
689
|
+
strncpy(binary_filename_resolved, wasi_filename, MAXPATHLEN);
|
|
678
690
|
#elif defined(__OpenBSD__)
|
|
679
691
|
_getBinaryPath2(binary_filename_target);
|
|
680
692
|
resolveFileSymbolicLink(binary_filename_target, binary_filename_target, buffer_size, resolve_symlinks);
|
|
@@ -949,8 +961,10 @@ bool expandTemplatePath(char *target, char const *source, size_t buffer_size) {
|
|
|
949
961
|
appendStringSafe(target, pid_buffer, buffer_size);
|
|
950
962
|
} else if (strcasecmp(var_name, "HOME") == 0) {
|
|
951
963
|
char const *home_path = getenv("HOME");
|
|
952
|
-
|
|
953
964
|
if (home_path == NULL) {
|
|
965
|
+
#ifdef __wasi__
|
|
966
|
+
return false;
|
|
967
|
+
#else
|
|
954
968
|
struct passwd *pw_data = getpwuid(getuid());
|
|
955
969
|
|
|
956
970
|
if (unlikely(pw_data == NULL)) {
|
|
@@ -958,6 +972,7 @@ bool expandTemplatePath(char *target, char const *source, size_t buffer_size) {
|
|
|
958
972
|
}
|
|
959
973
|
|
|
960
974
|
home_path = pw_data->pw_dir;
|
|
975
|
+
#endif
|
|
961
976
|
}
|
|
962
977
|
|
|
963
978
|
appendStringSafe(target, home_path, buffer_size);
|
|
@@ -236,7 +236,7 @@ PyObject *IMPORT_NAME_FROM_MODULE(PyThreadState *tstate, PyObject *module, PyObj
|
|
|
236
236
|
Py_DECREF(filename);
|
|
237
237
|
Py_DECREF(name);
|
|
238
238
|
|
|
239
|
-
#elif PYTHON_VERSION >=
|
|
239
|
+
#elif PYTHON_VERSION >= 0x300 || !defined(_NUITKA_FULL_COMPAT)
|
|
240
240
|
PyErr_Format(PyExc_ImportError, "cannot import name '%s'", Nuitka_String_AsString(import_name));
|
|
241
241
|
#else
|
|
242
242
|
PyErr_Format(PyExc_ImportError, "cannot import name %s", Nuitka_String_AsString(import_name));
|
|
@@ -227,7 +227,7 @@ bool LIST_EXTEND_FROM_ITERABLE(PyThreadState *tstate, PyObject *target, PyObject
|
|
|
227
227
|
|
|
228
228
|
Py_ssize_t cur_size = PyList_GET_SIZE(list);
|
|
229
229
|
|
|
230
|
-
#if PYTHON_VERSION >=
|
|
230
|
+
#if PYTHON_VERSION >= 0x300
|
|
231
231
|
// Guess a iterator size if possible
|
|
232
232
|
src_size = PyObject_LengthHint(other, 8);
|
|
233
233
|
|
|
@@ -757,6 +757,8 @@ PyObject *MAKE_LIST(PyThreadState *tstate, PyObject *iterable) {
|
|
|
757
757
|
return list;
|
|
758
758
|
}
|
|
759
759
|
#else
|
|
760
|
+
Py_INCREF(iterable);
|
|
761
|
+
|
|
760
762
|
#if PYTHON_VERSION >= 0x340
|
|
761
763
|
if (Nuitka_PyObject_HasLen(iterable)) {
|
|
762
764
|
Py_ssize_t iter_len = Nuitka_PyObject_Size(iterable);
|
|
@@ -779,6 +781,8 @@ PyObject *MAKE_LIST(PyThreadState *tstate, PyObject *iterable) {
|
|
|
779
781
|
|
|
780
782
|
bool res = LIST_EXTEND_FROM_ITERABLE(tstate, list, iterable);
|
|
781
783
|
|
|
784
|
+
Py_DECREF(iterable);
|
|
785
|
+
|
|
782
786
|
if (unlikely(res == false)) {
|
|
783
787
|
Py_DECREF(list);
|
|
784
788
|
return NULL;
|
|
@@ -18,46 +18,59 @@ static void FORMAT_MATCH_MISMATCH_ERROR(PyTypeObject *type, Py_ssize_t max_allow
|
|
|
18
18
|
((PyTypeObject *)type)->tp_name, max_allowed, plural_form, actual);
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
PyObject *MATCH_CLASS_ARGS(PyThreadState *tstate, PyObject *matched,
|
|
21
|
+
PyObject *MATCH_CLASS_ARGS(PyThreadState *tstate, PyObject *matched, PyObject *matched_type,
|
|
22
|
+
Py_ssize_t positional_count, PyObject **keywords, Py_ssize_t keywords_count) {
|
|
22
23
|
PyObject *match_args = NULL;
|
|
23
|
-
PyTypeObject *type =
|
|
24
|
+
PyTypeObject *type = (PyTypeObject *)matched_type;
|
|
24
25
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
PyObject *seen = NULL;
|
|
27
|
+
bool needs_check = positional_count + keywords_count > 1;
|
|
28
|
+
if (needs_check) {
|
|
29
|
+
seen = PySet_New(NULL);
|
|
30
|
+
}
|
|
28
31
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
32
|
+
assert(positional_count + keywords_count > 0);
|
|
33
|
+
|
|
34
|
+
// First, the positional sub-patterns if any.
|
|
35
|
+
if (positional_count > 0) {
|
|
36
|
+
match_args = LOOKUP_ATTRIBUTE(tstate, (PyObject *)type, const_str_plain___match_args__);
|
|
37
|
+
Py_ssize_t actual;
|
|
36
38
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
if (match_args) {
|
|
40
|
+
if (unlikely(!PyTuple_CheckExact(match_args))) {
|
|
41
|
+
PyErr_Format(PyExc_TypeError, "%s.__match_args__ must be a tuple (got %s)", type->tp_name,
|
|
42
|
+
Py_TYPE(match_args)->tp_name);
|
|
43
|
+
Py_DECREF(match_args);
|
|
42
44
|
return NULL;
|
|
43
45
|
}
|
|
44
46
|
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
+
actual = PyTuple_GET_SIZE(match_args);
|
|
48
|
+
} else if (CHECK_AND_CLEAR_ATTRIBUTE_ERROR_OCCURRED(tstate)) {
|
|
49
|
+
if (PyType_HasFeature(type, _Py_TPFLAGS_MATCH_SELF)) {
|
|
50
|
+
if (positional_count > 1) {
|
|
51
|
+
FORMAT_MATCH_MISMATCH_ERROR(type, positional_count, 1);
|
|
52
|
+
return NULL;
|
|
53
|
+
}
|
|
47
54
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
55
|
+
assert(keywords_count == 0);
|
|
56
|
+
|
|
57
|
+
return MAKE_TUPLE1(tstate, matched);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
actual = 0;
|
|
61
|
+
} else {
|
|
62
|
+
return NULL;
|
|
63
|
+
}
|
|
52
64
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
65
|
+
if (positional_count > actual) {
|
|
66
|
+
FORMAT_MATCH_MISMATCH_ERROR(type, positional_count, actual);
|
|
67
|
+
return NULL;
|
|
68
|
+
}
|
|
56
69
|
}
|
|
57
70
|
|
|
58
|
-
PyObject *result = MAKE_TUPLE_EMPTY_VAR(tstate,
|
|
71
|
+
PyObject *result = MAKE_TUPLE_EMPTY_VAR(tstate, positional_count + keywords_count);
|
|
59
72
|
|
|
60
|
-
for (Py_ssize_t i = 0; i <
|
|
73
|
+
for (Py_ssize_t i = 0; i < positional_count; i++) {
|
|
61
74
|
PyObject *arg_name = PyTuple_GET_ITEM(match_args, i);
|
|
62
75
|
|
|
63
76
|
if (unlikely(!PyUnicode_CheckExact(arg_name))) {
|
|
@@ -72,27 +85,74 @@ PyObject *MATCH_CLASS_ARGS(PyThreadState *tstate, PyObject *matched, Py_ssize_t
|
|
|
72
85
|
return NULL;
|
|
73
86
|
}
|
|
74
87
|
|
|
88
|
+
if (needs_check) {
|
|
89
|
+
if (i != 0 && PySet_Contains(seen, arg_name)) {
|
|
90
|
+
_PyErr_Format(tstate, PyExc_TypeError, "%s() got multiple sub-patterns for attribute %R",
|
|
91
|
+
((PyTypeObject *)type)->tp_name, arg_name);
|
|
92
|
+
|
|
93
|
+
return NULL;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
PySet_Add(seen, arg_name);
|
|
97
|
+
}
|
|
98
|
+
|
|
75
99
|
PyObject *arg_value = LOOKUP_ATTRIBUTE(tstate, matched, arg_name);
|
|
76
100
|
if (unlikely(arg_value == NULL)) {
|
|
101
|
+
DROP_ERROR_OCCURRED(tstate);
|
|
102
|
+
|
|
77
103
|
Py_DECREF(match_args);
|
|
78
104
|
Py_DECREF(result);
|
|
79
105
|
|
|
80
|
-
|
|
106
|
+
Py_INCREF_IMMORTAL(Py_None);
|
|
107
|
+
return Py_None;
|
|
81
108
|
}
|
|
82
109
|
|
|
83
110
|
PyTuple_SET_ITEM(result, i, arg_value);
|
|
84
111
|
}
|
|
85
112
|
|
|
86
|
-
|
|
113
|
+
for (Py_ssize_t i = 0; i < keywords_count; i++) {
|
|
114
|
+
PyObject *arg_name = keywords[i];
|
|
115
|
+
CHECK_OBJECT(arg_name);
|
|
116
|
+
assert(PyUnicode_CheckExact(arg_name));
|
|
117
|
+
|
|
118
|
+
if (needs_check) {
|
|
119
|
+
if (PySet_Contains(seen, arg_name)) {
|
|
120
|
+
_PyErr_Format(tstate, PyExc_TypeError, "%s() got multiple sub-patterns for attribute %R",
|
|
121
|
+
((PyTypeObject *)type)->tp_name, arg_name);
|
|
122
|
+
|
|
123
|
+
return NULL;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
PySet_Add(seen, arg_name);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
PyObject *arg_value = LOOKUP_ATTRIBUTE(tstate, matched, arg_name);
|
|
130
|
+
if (unlikely(arg_value == NULL)) {
|
|
131
|
+
DROP_ERROR_OCCURRED(tstate);
|
|
132
|
+
|
|
133
|
+
Py_DECREF(match_args);
|
|
134
|
+
Py_DECREF(result);
|
|
135
|
+
|
|
136
|
+
Py_INCREF_IMMORTAL(Py_None);
|
|
137
|
+
return Py_None;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
PyTuple_SET_ITEM(result, positional_count + i, arg_value);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
Py_XDECREF(match_args);
|
|
87
144
|
return result;
|
|
88
145
|
}
|
|
89
146
|
|
|
90
|
-
|
|
147
|
+
bool MATCH_MAPPING_KEY(PyThreadState *tstate, PyObject *map, PyObject *key) {
|
|
91
148
|
// Need to use get_method with default value, so "defaultdict" do not
|
|
92
149
|
// mutate. TODO: Use a cached value across the "match".
|
|
150
|
+
// spell-checker: ignore defaultdict
|
|
93
151
|
PyObject *get_method = LOOKUP_ATTRIBUTE(tstate, map, const_str_plain_get);
|
|
94
152
|
if (unlikely(get_method == NULL)) {
|
|
95
|
-
|
|
153
|
+
// TODO: Maybe only drop AttributeError?
|
|
154
|
+
DROP_ERROR_OCCURRED(tstate);
|
|
155
|
+
return false;
|
|
96
156
|
}
|
|
97
157
|
|
|
98
158
|
PyObject *args[] = {key, Nuitka_sentinel_value};
|
|
@@ -102,18 +162,18 @@ int MATCH_MAPPING_KEY(PyThreadState *tstate, PyObject *map, PyObject *key) {
|
|
|
102
162
|
Py_XDECREF(get_method);
|
|
103
163
|
|
|
104
164
|
if (unlikely(value == NULL)) {
|
|
105
|
-
return
|
|
165
|
+
return false;
|
|
106
166
|
}
|
|
107
167
|
|
|
108
168
|
if (value == Nuitka_sentinel_value) {
|
|
109
169
|
Py_DECREF_IMMORTAL(value);
|
|
110
170
|
|
|
111
|
-
return
|
|
171
|
+
return false;
|
|
112
172
|
}
|
|
113
173
|
|
|
114
174
|
Py_DECREF(value);
|
|
115
175
|
|
|
116
|
-
return
|
|
176
|
+
return true;
|
|
117
177
|
}
|
|
118
178
|
|
|
119
179
|
// Part of "Nuitka", an optimizing Python compiler that is compatible and
|
|
@@ -245,7 +245,7 @@ static HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_ADD_OBJECT_INT(PyObject **op
|
|
|
245
245
|
}
|
|
246
246
|
}
|
|
247
247
|
|
|
248
|
-
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for
|
|
248
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for +=: '%s' and 'int'", type1->tp_name);
|
|
249
249
|
goto exit_inplace_exception;
|
|
250
250
|
}
|
|
251
251
|
|
|
@@ -497,7 +497,7 @@ static HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_ADD_INT_OBJECT(PyObject **op
|
|
|
497
497
|
// No inplace sequence repeat slot sq_inplace_concat available for this type.
|
|
498
498
|
}
|
|
499
499
|
|
|
500
|
-
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for
|
|
500
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for +=: 'int' and '%s'", type2->tp_name);
|
|
501
501
|
goto exit_inplace_exception;
|
|
502
502
|
}
|
|
503
503
|
|
|
@@ -881,9 +881,9 @@ static HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_ADD_OBJECT_LONG(PyObject **o
|
|
|
881
881
|
}
|
|
882
882
|
|
|
883
883
|
#if PYTHON_VERSION < 0x300
|
|
884
|
-
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for
|
|
884
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for +=: '%s' and 'long'", type1->tp_name);
|
|
885
885
|
#else
|
|
886
|
-
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for
|
|
886
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for +=: '%s' and 'int'", type1->tp_name);
|
|
887
887
|
#endif
|
|
888
888
|
goto exit_inplace_exception;
|
|
889
889
|
}
|
|
@@ -1180,9 +1180,9 @@ static HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_ADD_LONG_OBJECT(PyObject **o
|
|
|
1180
1180
|
}
|
|
1181
1181
|
|
|
1182
1182
|
#if PYTHON_VERSION < 0x300
|
|
1183
|
-
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for
|
|
1183
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for +=: 'long' and '%s'", type2->tp_name);
|
|
1184
1184
|
#else
|
|
1185
|
-
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for
|
|
1185
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for +=: 'int' and '%s'", type2->tp_name);
|
|
1186
1186
|
#endif
|
|
1187
1187
|
goto exit_inplace_exception;
|
|
1188
1188
|
}
|
|
@@ -1540,7 +1540,7 @@ static HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_ADD_OBJECT_FLOAT(PyObject **
|
|
|
1540
1540
|
}
|
|
1541
1541
|
}
|
|
1542
1542
|
|
|
1543
|
-
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for
|
|
1543
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for +=: '%s' and 'float'", type1->tp_name);
|
|
1544
1544
|
goto exit_inplace_exception;
|
|
1545
1545
|
}
|
|
1546
1546
|
|
|
@@ -1765,7 +1765,7 @@ static HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_ADD_FLOAT_OBJECT(PyObject **
|
|
|
1765
1765
|
// No inplace sequence repeat slot sq_inplace_concat available for this type.
|
|
1766
1766
|
}
|
|
1767
1767
|
|
|
1768
|
-
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for
|
|
1768
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for +=: 'float' and '%s'", type2->tp_name);
|
|
1769
1769
|
goto exit_inplace_exception;
|
|
1770
1770
|
}
|
|
1771
1771
|
|
|
@@ -1889,9 +1889,9 @@ static inline bool _INPLACE_OPERATION_ADD_FLOAT_LONG(PyObject **operand1, PyObje
|
|
|
1889
1889
|
}
|
|
1890
1890
|
|
|
1891
1891
|
#if PYTHON_VERSION < 0x300
|
|
1892
|
-
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for
|
|
1892
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for +=: 'float' and 'long'");
|
|
1893
1893
|
#else
|
|
1894
|
-
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for
|
|
1894
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for +=: 'float' and 'int'");
|
|
1895
1895
|
#endif
|
|
1896
1896
|
goto exit_inplace_exception;
|
|
1897
1897
|
}
|
|
@@ -1968,9 +1968,9 @@ static inline bool _INPLACE_OPERATION_ADD_LONG_FLOAT(PyObject **operand1, PyObje
|
|
|
1968
1968
|
}
|
|
1969
1969
|
|
|
1970
1970
|
#if PYTHON_VERSION < 0x300
|
|
1971
|
-
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for
|
|
1971
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for +=: 'long' and 'float'");
|
|
1972
1972
|
#else
|
|
1973
|
-
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for
|
|
1973
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for +=: 'int' and 'float'");
|
|
1974
1974
|
#endif
|
|
1975
1975
|
goto exit_inplace_exception;
|
|
1976
1976
|
}
|
|
@@ -2041,7 +2041,7 @@ static inline bool _INPLACE_OPERATION_ADD_FLOAT_INT(PyObject **operand1, PyObjec
|
|
|
2041
2041
|
// No inplace sequence repeat slot sq_inplace_concat available for this type.
|
|
2042
2042
|
}
|
|
2043
2043
|
|
|
2044
|
-
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for
|
|
2044
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for +=: 'float' and 'int'");
|
|
2045
2045
|
goto exit_inplace_exception;
|
|
2046
2046
|
}
|
|
2047
2047
|
|
|
@@ -2118,7 +2118,7 @@ static inline bool _INPLACE_OPERATION_ADD_INT_FLOAT(PyObject **operand1, PyObjec
|
|
|
2118
2118
|
// No inplace sequence repeat slot sq_inplace_concat available for this type.
|
|
2119
2119
|
}
|
|
2120
2120
|
|
|
2121
|
-
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for
|
|
2121
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for +=: 'int' and 'float'");
|
|
2122
2122
|
goto exit_inplace_exception;
|
|
2123
2123
|
}
|
|
2124
2124
|
|
|
@@ -2189,7 +2189,7 @@ static inline bool _INPLACE_OPERATION_ADD_LONG_INT(PyObject **operand1, PyObject
|
|
|
2189
2189
|
// No inplace sequence repeat slot sq_inplace_concat available for this type.
|
|
2190
2190
|
}
|
|
2191
2191
|
|
|
2192
|
-
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for
|
|
2192
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for +=: 'long' and 'int'");
|
|
2193
2193
|
goto exit_inplace_exception;
|
|
2194
2194
|
}
|
|
2195
2195
|
|
|
@@ -2266,7 +2266,7 @@ static inline bool _INPLACE_OPERATION_ADD_INT_LONG(PyObject **operand1, PyObject
|
|
|
2266
2266
|
// No inplace sequence repeat slot sq_inplace_concat available for this type.
|
|
2267
2267
|
}
|
|
2268
2268
|
|
|
2269
|
-
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for
|
|
2269
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for +=: 'int' and 'long'");
|
|
2270
2270
|
goto exit_inplace_exception;
|
|
2271
2271
|
}
|
|
2272
2272
|
|
|
@@ -2703,7 +2703,7 @@ static HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_ADD_OBJECT_STR(PyObject **op
|
|
|
2703
2703
|
}
|
|
2704
2704
|
}
|
|
2705
2705
|
|
|
2706
|
-
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for
|
|
2706
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for +=: '%s' and 'str'", type1->tp_name);
|
|
2707
2707
|
goto exit_inplace_exception;
|
|
2708
2708
|
}
|
|
2709
2709
|
|
|
@@ -3096,9 +3096,9 @@ static HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_ADD_OBJECT_UNICODE(PyObject
|
|
|
3096
3096
|
}
|
|
3097
3097
|
|
|
3098
3098
|
#if PYTHON_VERSION < 0x300
|
|
3099
|
-
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for
|
|
3099
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for +=: '%s' and 'unicode'", type1->tp_name);
|
|
3100
3100
|
#else
|
|
3101
|
-
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for
|
|
3101
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for +=: '%s' and 'str'", type1->tp_name);
|
|
3102
3102
|
#endif
|
|
3103
3103
|
goto exit_inplace_exception;
|
|
3104
3104
|
}
|
|
@@ -3497,7 +3497,7 @@ static HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_ADD_OBJECT_BYTES(PyObject **
|
|
|
3497
3497
|
}
|
|
3498
3498
|
}
|
|
3499
3499
|
|
|
3500
|
-
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for
|
|
3500
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for +=: '%s' and 'bytes'", type1->tp_name);
|
|
3501
3501
|
goto exit_inplace_exception;
|
|
3502
3502
|
}
|
|
3503
3503
|
|
|
@@ -3890,7 +3890,7 @@ static HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_ADD_OBJECT_TUPLE(PyObject **
|
|
|
3890
3890
|
}
|
|
3891
3891
|
}
|
|
3892
3892
|
|
|
3893
|
-
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for
|
|
3893
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for +=: '%s' and 'tuple'", type1->tp_name);
|
|
3894
3894
|
goto exit_inplace_exception;
|
|
3895
3895
|
}
|
|
3896
3896
|
|
|
@@ -4282,7 +4282,7 @@ static HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_ADD_OBJECT_LIST(PyObject **o
|
|
|
4282
4282
|
}
|
|
4283
4283
|
}
|
|
4284
4284
|
|
|
4285
|
-
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for
|
|
4285
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for +=: '%s' and 'list'", type1->tp_name);
|
|
4286
4286
|
goto exit_inplace_exception;
|
|
4287
4287
|
}
|
|
4288
4288
|
|
|
@@ -4945,7 +4945,7 @@ static inline bool _INPLACE_OPERATION_ADD_OBJECT_OBJECT(PyObject **operand1, PyO
|
|
|
4945
4945
|
}
|
|
4946
4946
|
}
|
|
4947
4947
|
|
|
4948
|
-
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for
|
|
4948
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for +=: '%s' and '%s'", type1->tp_name,
|
|
4949
4949
|
type2->tp_name);
|
|
4950
4950
|
goto exit_inplace_exception;
|
|
4951
4951
|
}
|
|
@@ -195,9 +195,9 @@ static HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_BITAND_OBJECT_LONG(PyObject
|
|
|
195
195
|
#endif
|
|
196
196
|
|
|
197
197
|
#if PYTHON_VERSION < 0x300
|
|
198
|
-
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for
|
|
198
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for &=: '%s' and 'long'", type1->tp_name);
|
|
199
199
|
#else
|
|
200
|
-
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for
|
|
200
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for &=: '%s' and 'int'", type1->tp_name);
|
|
201
201
|
#endif
|
|
202
202
|
goto exit_inplace_exception;
|
|
203
203
|
}
|
|
@@ -412,9 +412,9 @@ static HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_BITAND_LONG_OBJECT(PyObject
|
|
|
412
412
|
#endif
|
|
413
413
|
|
|
414
414
|
#if PYTHON_VERSION < 0x300
|
|
415
|
-
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for
|
|
415
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for &=: 'long' and '%s'", type2->tp_name);
|
|
416
416
|
#else
|
|
417
|
-
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for
|
|
417
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for &=: 'int' and '%s'", type2->tp_name);
|
|
418
418
|
#endif
|
|
419
419
|
goto exit_inplace_exception;
|
|
420
420
|
}
|
|
@@ -683,7 +683,7 @@ static HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_BITAND_OBJECT_INT(PyObject *
|
|
|
683
683
|
}
|
|
684
684
|
#endif
|
|
685
685
|
|
|
686
|
-
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for
|
|
686
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for &=: '%s' and 'int'", type1->tp_name);
|
|
687
687
|
goto exit_inplace_exception;
|
|
688
688
|
}
|
|
689
689
|
|
|
@@ -905,7 +905,7 @@ static HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_BITAND_INT_OBJECT(PyObject *
|
|
|
905
905
|
}
|
|
906
906
|
#endif
|
|
907
907
|
|
|
908
|
-
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for
|
|
908
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for &=: 'int' and '%s'", type2->tp_name);
|
|
909
909
|
goto exit_inplace_exception;
|
|
910
910
|
}
|
|
911
911
|
|
|
@@ -1076,7 +1076,7 @@ static inline bool _INPLACE_OPERATION_BITAND_LONG_INT(PyObject **operand1, PyObj
|
|
|
1076
1076
|
|
|
1077
1077
|
// Statically recognized that coercion is not possible with these types
|
|
1078
1078
|
|
|
1079
|
-
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for
|
|
1079
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for &=: 'long' and 'int'");
|
|
1080
1080
|
goto exit_inplace_exception;
|
|
1081
1081
|
}
|
|
1082
1082
|
|
|
@@ -1148,7 +1148,7 @@ static inline bool _INPLACE_OPERATION_BITAND_INT_LONG(PyObject **operand1, PyObj
|
|
|
1148
1148
|
|
|
1149
1149
|
// Statically recognized that coercion is not possible with these types
|
|
1150
1150
|
|
|
1151
|
-
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for
|
|
1151
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for &=: 'int' and 'long'");
|
|
1152
1152
|
goto exit_inplace_exception;
|
|
1153
1153
|
}
|
|
1154
1154
|
|
|
@@ -1320,7 +1320,7 @@ static HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_BITAND_OBJECT_SET(PyObject *
|
|
|
1320
1320
|
}
|
|
1321
1321
|
#endif
|
|
1322
1322
|
|
|
1323
|
-
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for
|
|
1323
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for &=: '%s' and 'set'", type1->tp_name);
|
|
1324
1324
|
goto exit_inplace_exception;
|
|
1325
1325
|
}
|
|
1326
1326
|
|
|
@@ -1504,7 +1504,7 @@ static HEDLEY_NEVER_INLINE bool __INPLACE_OPERATION_BITAND_SET_OBJECT(PyObject *
|
|
|
1504
1504
|
}
|
|
1505
1505
|
#endif
|
|
1506
1506
|
|
|
1507
|
-
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for
|
|
1507
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for &=: 'set' and '%s'", type2->tp_name);
|
|
1508
1508
|
goto exit_inplace_exception;
|
|
1509
1509
|
}
|
|
1510
1510
|
|
|
@@ -1783,7 +1783,7 @@ static inline bool _INPLACE_OPERATION_BITAND_OBJECT_OBJECT(PyObject **operand1,
|
|
|
1783
1783
|
}
|
|
1784
1784
|
#endif
|
|
1785
1785
|
|
|
1786
|
-
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for
|
|
1786
|
+
PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for &=: '%s' and '%s'", type1->tp_name,
|
|
1787
1787
|
type2->tp_name);
|
|
1788
1788
|
goto exit_inplace_exception;
|
|
1789
1789
|
}
|