Nuitka-winsvc 2.4.11__cp311-cp311-win_amd64.whl → 2.5.6__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.4.11.dist-info → Nuitka_winsvc-2.5.6.dist-info}/METADATA +56 -109
- {Nuitka_winsvc-2.4.11.dist-info → Nuitka_winsvc-2.5.6.dist-info}/RECORD +304 -280
- {Nuitka_winsvc-2.4.11.dist-info → Nuitka_winsvc-2.5.6.dist-info}/WHEEL +1 -1
- nuitka/Builtins.py +31 -0
- nuitka/HardImportRegistry.py +8 -0
- nuitka/MainControl.py +9 -4
- nuitka/OptionParsing.py +108 -54
- nuitka/Options.py +69 -13
- nuitka/OutputDirectories.py +7 -2
- nuitka/PostProcessing.py +69 -38
- nuitka/Progress.py +16 -1
- nuitka/PythonVersions.py +2 -1
- nuitka/Serialization.py +4 -2
- nuitka/Tracing.py +69 -1
- nuitka/Version.py +2 -2
- nuitka/build/Backend.scons +45 -5
- nuitka/build/CCompilerVersion.scons +6 -0
- nuitka/build/Onefile.scons +6 -0
- nuitka/build/SconsCaching.py +4 -0
- nuitka/build/SconsCompilerSettings.py +14 -3
- nuitka/build/SconsInterface.py +3 -0
- nuitka/build/SconsUtils.py +5 -0
- nuitka/build/include/nuitka/allocator.h +124 -1
- nuitka/build/include/nuitka/calling.h +6 -6
- nuitka/build/include/nuitka/compiled_asyncgen.h +10 -7
- nuitka/build/include/nuitka/compiled_frame.h +2 -1
- nuitka/build/include/nuitka/constants.h +8 -0
- nuitka/build/include/nuitka/debug_settings.h +60 -0
- nuitka/build/include/nuitka/exceptions.h +264 -121
- nuitka/build/include/nuitka/helper/attributes.h +0 -4
- nuitka/build/include/nuitka/helper/calling_generated.h +52 -52
- nuitka/build/include/nuitka/helper/comparisons_dual_eq.h +47 -0
- nuitka/build/include/nuitka/helper/comparisons_dual_ge.h +39 -0
- nuitka/build/include/nuitka/helper/comparisons_dual_gt.h +39 -0
- nuitka/build/include/nuitka/helper/comparisons_dual_le.h +47 -0
- nuitka/build/include/nuitka/helper/comparisons_dual_lt.h +47 -0
- nuitka/build/include/nuitka/helper/comparisons_dual_ne.h +39 -0
- nuitka/build/include/nuitka/helper/dictionaries.h +75 -31
- nuitka/build/include/nuitka/helper/ints.h +86 -37
- nuitka/build/include/nuitka/helper/iterators.h +82 -34
- nuitka/build/include/nuitka/helper/operations.h +3 -0
- nuitka/build/include/nuitka/helper/operations_binary_add.h +6 -0
- nuitka/build/include/nuitka/helper/operations_binary_dual_add.h +34 -0
- nuitka/build/include/nuitka/helper/operations_binary_sub.h +6 -0
- nuitka/build/include/nuitka/helper/operations_inplace_add.h +3 -0
- nuitka/build/include/nuitka/helper/operations_inplace_sub.h +3 -0
- nuitka/build/include/nuitka/helper/raising.h +47 -28
- nuitka/build/include/nuitka/helper/richcomparisons.h +7 -0
- nuitka/build/include/nuitka/helper/tuples.h +12 -0
- nuitka/build/include/nuitka/helpers.h +12 -2
- nuitka/build/include/nuitka/prelude.h +36 -25
- nuitka/build/include/nuitka/printing.h +9 -7
- nuitka/build/include/nuitka/threading.h +15 -1
- nuitka/build/include/nuitka/type_aliases.h +3 -0
- nuitka/build/inline_copy/stubgen/astunparse.py +938 -0
- nuitka/build/inline_copy/stubgen/six.py +998 -0
- nuitka/build/inline_copy/stubgen/stubgen.py +307 -0
- nuitka/build/static_src/CompiledAsyncgenType.c +45 -39
- nuitka/build/static_src/CompiledCellType.c +6 -4
- nuitka/build/static_src/CompiledCodeHelpers.c +106 -40
- nuitka/build/static_src/CompiledCoroutineType.c +41 -31
- nuitka/build/static_src/CompiledFrameType.c +110 -79
- nuitka/build/static_src/CompiledFunctionType.c +173 -151
- nuitka/build/static_src/CompiledGeneratorType.c +51 -49
- nuitka/build/static_src/CompiledGeneratorTypeUncompiledIntegration.c +433 -46
- nuitka/build/static_src/CompiledMethodType.c +6 -12
- nuitka/build/static_src/HelpersAllocator.c +266 -28
- nuitka/build/static_src/HelpersAttributes.c +0 -21
- nuitka/build/static_src/HelpersBuiltin.c +23 -14
- nuitka/build/static_src/HelpersCalling.c +7 -7
- nuitka/build/static_src/HelpersCallingGenerated.c +70 -70
- nuitka/build/static_src/HelpersComparisonDualEq.c +183 -0
- nuitka/build/static_src/HelpersComparisonDualGe.c +121 -0
- nuitka/build/static_src/HelpersComparisonDualGt.c +121 -0
- nuitka/build/static_src/HelpersComparisonDualLe.c +183 -0
- nuitka/build/static_src/HelpersComparisonDualLt.c +183 -0
- nuitka/build/static_src/HelpersComparisonDualNe.c +121 -0
- nuitka/build/static_src/HelpersComparisonEq.c +18 -4
- nuitka/build/static_src/HelpersComparisonGe.c +18 -4
- nuitka/build/static_src/HelpersComparisonGt.c +18 -4
- nuitka/build/static_src/HelpersComparisonLe.c +18 -4
- nuitka/build/static_src/HelpersComparisonLt.c +18 -4
- nuitka/build/static_src/HelpersComparisonNe.c +18 -4
- nuitka/build/static_src/HelpersConsole.c +34 -8
- nuitka/build/static_src/HelpersConstantsBlob.c +4 -2
- nuitka/build/static_src/HelpersDeepcopy.c +1 -0
- nuitka/build/static_src/HelpersDictionaries.c +195 -36
- nuitka/build/static_src/HelpersDictionariesGenerated.c +12 -107
- nuitka/build/static_src/HelpersExceptions.c +24 -50
- nuitka/build/static_src/HelpersFiles.c +79 -5
- nuitka/build/static_src/HelpersImport.c +13 -9
- nuitka/build/static_src/HelpersImportHard.c +23 -46
- nuitka/build/static_src/HelpersLists.c +98 -9
- nuitka/build/static_src/HelpersOperationBinaryAdd.c +224 -6
- nuitka/build/static_src/HelpersOperationBinaryAddUtils.c +3 -0
- nuitka/build/static_src/HelpersOperationBinaryBitand.c +5 -5
- nuitka/build/static_src/HelpersOperationBinaryBitor.c +5 -5
- nuitka/build/static_src/HelpersOperationBinaryBitxor.c +5 -5
- nuitka/build/static_src/HelpersOperationBinaryDivmod.c +8 -2
- nuitka/build/static_src/HelpersOperationBinaryDualAdd.c +172 -0
- nuitka/build/static_src/HelpersOperationBinaryFloordiv.c +14 -8
- nuitka/build/static_src/HelpersOperationBinaryLshift.c +36 -36
- nuitka/build/static_src/HelpersOperationBinaryMatmult.c +1 -0
- nuitka/build/static_src/HelpersOperationBinaryMod.c +22 -10
- nuitka/build/static_src/HelpersOperationBinaryMult.c +17 -7
- nuitka/build/static_src/HelpersOperationBinaryOlddiv.c +14 -8
- nuitka/build/static_src/HelpersOperationBinaryPow.c +24 -24
- nuitka/build/static_src/HelpersOperationBinaryRshift.c +4 -4
- nuitka/build/static_src/HelpersOperationBinarySub.c +229 -8
- nuitka/build/static_src/HelpersOperationBinaryTruediv.c +8 -2
- nuitka/build/static_src/HelpersOperationInplaceAdd.c +162 -10
- nuitka/build/static_src/HelpersOperationInplaceBitand.c +5 -5
- nuitka/build/static_src/HelpersOperationInplaceBitor.c +5 -5
- nuitka/build/static_src/HelpersOperationInplaceBitxor.c +5 -5
- nuitka/build/static_src/HelpersOperationInplaceFloordiv.c +11 -6
- nuitka/build/static_src/HelpersOperationInplaceLshift.c +20 -20
- nuitka/build/static_src/HelpersOperationInplaceMatmult.c +1 -0
- nuitka/build/static_src/HelpersOperationInplaceMod.c +11 -6
- nuitka/build/static_src/HelpersOperationInplaceMult.c +11 -6
- nuitka/build/static_src/HelpersOperationInplaceOlddiv.c +11 -6
- nuitka/build/static_src/HelpersOperationInplacePow.c +20 -20
- nuitka/build/static_src/HelpersOperationInplaceRshift.c +4 -4
- nuitka/build/static_src/HelpersOperationInplaceSub.c +163 -10
- nuitka/build/static_src/HelpersOperationInplaceTruediv.c +6 -1
- nuitka/build/static_src/HelpersProfiling.c +1 -1
- nuitka/build/static_src/HelpersRaising.c +255 -310
- nuitka/build/static_src/HelpersStrings.c +1 -1
- nuitka/build/static_src/HelpersTuples.c +2 -2
- nuitka/build/static_src/HelpersTypes.c +98 -2
- nuitka/build/static_src/MainProgram.c +132 -28
- nuitka/build/static_src/MetaPathBasedLoader.c +18 -19
- nuitka/build/static_src/MetaPathBasedLoaderResourceReaderFiles.c +134 -11
- nuitka/build/static_src/OnefileBootstrap.c +6 -1
- nuitka/code_generation/AsyncgenCodes.py +2 -6
- nuitka/code_generation/BinaryOperationHelperDefinitions.py +269 -167
- nuitka/code_generation/BuiltinCodes.py +9 -1
- nuitka/code_generation/CallCodes.py +16 -16
- nuitka/code_generation/CodeGeneration.py +14 -2
- nuitka/code_generation/CodeHelperSelection.py +1 -1
- nuitka/code_generation/CodeHelpers.py +4 -1
- nuitka/code_generation/CodeObjectCodes.py +2 -2
- nuitka/code_generation/ComparisonCodes.py +13 -2
- nuitka/code_generation/ComparisonHelperDefinitions.py +23 -8
- nuitka/code_generation/Contexts.py +28 -16
- nuitka/code_generation/CoroutineCodes.py +2 -6
- nuitka/code_generation/DictCodes.py +3 -3
- nuitka/code_generation/ErrorCodes.py +34 -50
- nuitka/code_generation/ExceptionCodes.py +165 -96
- nuitka/code_generation/ExpressionCTypeSelectionHelpers.py +25 -10
- nuitka/code_generation/FrameCodes.py +4 -11
- nuitka/code_generation/FunctionCodes.py +2 -6
- nuitka/code_generation/GeneratorCodes.py +2 -6
- nuitka/code_generation/GlobalConstants.py +8 -2
- nuitka/code_generation/GlobalsLocalsCodes.py +2 -2
- nuitka/code_generation/IteratorCodes.py +67 -54
- nuitka/code_generation/LineNumberCodes.py +1 -3
- nuitka/code_generation/ModuleCodes.py +28 -4
- nuitka/code_generation/OperationCodes.py +51 -20
- nuitka/code_generation/PackageResourceCodes.py +37 -0
- nuitka/code_generation/RaisingCodes.py +164 -90
- nuitka/code_generation/Reports.py +13 -5
- nuitka/code_generation/ReturnCodes.py +2 -16
- nuitka/code_generation/TryCodes.py +12 -24
- nuitka/code_generation/TypeAliasCodes.py +48 -0
- nuitka/code_generation/VariableCodes.py +99 -40
- nuitka/code_generation/VariableDeclarations.py +8 -8
- nuitka/code_generation/YieldCodes.py +1 -1
- nuitka/code_generation/c_types/CTypeBases.py +10 -2
- nuitka/code_generation/c_types/CTypeModuleDictVariables.py +3 -0
- nuitka/code_generation/c_types/CTypeNuitkaBooleans.py +3 -4
- nuitka/code_generation/c_types/CTypeNuitkaInts.py +70 -25
- nuitka/code_generation/c_types/CTypeNuitkaVoids.py +1 -1
- nuitka/code_generation/c_types/CTypePyObjectPointers.py +16 -6
- nuitka/code_generation/templates/CodeTemplatesAsyncgens.py +2 -2
- nuitka/code_generation/templates/CodeTemplatesConstants.py +11 -3
- nuitka/code_generation/templates/CodeTemplatesCoroutines.py +2 -2
- nuitka/code_generation/templates/CodeTemplatesExceptions.py +15 -16
- nuitka/code_generation/templates/CodeTemplatesFrames.py +18 -10
- nuitka/code_generation/templates/CodeTemplatesFunction.py +2 -2
- nuitka/code_generation/templates/CodeTemplatesGeneratorFunction.py +2 -2
- nuitka/code_generation/templates/CodeTemplatesIterators.py +1 -35
- nuitka/code_generation/templates/CodeTemplatesModules.py +34 -4
- nuitka/code_generation/templates/CodeTemplatesVariables.py +76 -0
- nuitka/code_generation/templates_c/CodeTemplateCallsMixed.c.j2 +3 -3
- nuitka/code_generation/templates_c/CodeTemplateCallsPositional.c.j2 +3 -3
- nuitka/code_generation/templates_c/HelperDictionaryCopy.c.j2 +4 -106
- nuitka/code_generation/templates_c/HelperImportHard.c.j2 +1 -2
- nuitka/code_generation/templates_c/HelperLongTools.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperOperationBinaryDual.c.j2 +115 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonBytes.c.j2 +9 -9
- nuitka/code_generation/templates_c/HelperOperationComparisonDual.c.j2 +86 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonFloat.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperOperationComparisonInt.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperOperationComparisonList.c.j2 +9 -9
- nuitka/code_generation/templates_c/HelperOperationComparisonLong.c.j2 +7 -7
- nuitka/code_generation/templates_c/HelperOperationComparisonStr.c.j2 +9 -9
- nuitka/code_generation/templates_c/HelperOperationComparisonTuple.c.j2 +7 -7
- nuitka/code_generation/templates_c/HelperOperationComparisonUnicode.c.j2 +4 -4
- nuitka/code_generation/templates_c/HelperSlotsBinary.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperSlotsInt.c.j2 +31 -31
- nuitka/code_generation/templates_c/HelperSlotsLong.c.j2 +1 -1
- nuitka/containers/Namedtuples.py +6 -0
- nuitka/containers/OrderedSets.py +105 -5
- nuitka/distutils/Build.py +14 -0
- nuitka/distutils/DistutilCommands.py +50 -10
- nuitka/finalizations/Finalization.py +3 -3
- nuitka/finalizations/FinalizeMarkups.py +10 -14
- nuitka/freezer/DependsExe.py +5 -2
- nuitka/freezer/DllDependenciesMacOS.py +18 -1
- nuitka/freezer/DllDependenciesWin32.py +26 -12
- nuitka/freezer/ImportDetection.py +6 -0
- nuitka/freezer/IncludedDataFiles.py +37 -6
- nuitka/freezer/Onefile.py +1 -0
- nuitka/freezer/Standalone.py +72 -18
- nuitka/importing/Importing.py +33 -6
- nuitka/importing/Recursion.py +5 -2
- nuitka/importing/StandardLibrary.py +57 -59
- nuitka/nodes/AsyncgenNodes.py +3 -6
- nuitka/nodes/BuiltinIteratorNodes.py +2 -2
- nuitka/nodes/BuiltinRefNodes.py +14 -30
- nuitka/nodes/ChildrenHavingMixins.py +439 -46
- nuitka/nodes/ConditionalNodes.py +3 -2
- nuitka/nodes/CoroutineNodes.py +3 -6
- nuitka/nodes/DictionaryNodes.py +1 -1
- nuitka/nodes/ExceptionNodes.py +102 -26
- nuitka/nodes/ExpressionBasesGenerated.py +288 -4
- nuitka/nodes/FrameNodes.py +22 -11
- nuitka/nodes/FunctionNodes.py +3 -3
- nuitka/nodes/GeneratorNodes.py +3 -6
- nuitka/nodes/HardImportNodesGenerated.py +182 -0
- nuitka/nodes/ImportNodes.py +2 -2
- nuitka/nodes/NodeBases.py +28 -1
- nuitka/nodes/NodeMakingHelpers.py +71 -50
- nuitka/nodes/OperatorNodesUnary.py +128 -3
- nuitka/nodes/OsSysNodes.py +37 -6
- nuitka/nodes/OutlineNodes.py +2 -2
- nuitka/nodes/StatementBasesGenerated.py +0 -2
- nuitka/nodes/StatementNodes.py +8 -7
- nuitka/nodes/SubscriptNodes.py +1 -1
- nuitka/nodes/TypeNodes.py +28 -1
- nuitka/nodes/VariableAssignNodes.py +2 -1
- nuitka/nodes/shapes/BuiltinTypeShapes.py +24 -7
- nuitka/nodes/shapes/IteratorShapes.py +71 -0
- nuitka/nodes/shapes/ShapeMixins.py +18 -0
- nuitka/nodes/shapes/StandardShapes.py +47 -44
- nuitka/optimizations/BytecodeDemotion.py +2 -1
- nuitka/plugins/PluginBase.py +64 -22
- nuitka/plugins/Plugins.py +16 -3
- nuitka/plugins/standard/AntiBloatPlugin.py +23 -12
- nuitka/plugins/standard/DllFilesPlugin.py +78 -2
- nuitka/plugins/standard/ImplicitImports.py +5 -15
- nuitka/plugins/standard/KivyPlugin.py +3 -12
- nuitka/plugins/standard/MatplotlibPlugin.py +12 -1
- nuitka/plugins/standard/MultiprocessingPlugin.py +11 -20
- nuitka/plugins/standard/OptionsNannyPlugin.py +5 -4
- nuitka/plugins/standard/PlaywrightPlugin.py +184 -0
- nuitka/plugins/standard/PySidePyQtPlugin.py +8 -0
- nuitka/plugins/standard/TkinterPlugin.py +23 -3
- nuitka/plugins/standard/TransformersPlugin.py +70 -275
- nuitka/plugins/standard/standard.nuitka-package.config.yml +413 -30
- nuitka/plugins/standard/stdlib3.nuitka-package.config.yml +35 -2
- nuitka/reports/CompilationReportReader.py +12 -0
- nuitka/reports/Reports.py +11 -0
- nuitka/specs/BuiltinParameterSpecs.py +5 -1
- nuitka/specs/HardImportSpecs.py +7 -0
- nuitka/specs/ParameterSpecs.py +4 -4
- nuitka/tools/environments/Virtualenv.py +13 -5
- nuitka/tools/general/dll_report/__main__.py +10 -1
- nuitka/tools/onefile_compressor/OnefileCompressor.py +1 -1
- nuitka/tools/podman/__main__.py +4 -2
- nuitka/tools/specialize/CTypeDescriptions.py +158 -9
- nuitka/tools/specialize/SpecializeC.py +218 -56
- nuitka/tools/testing/Common.py +69 -62
- nuitka/tools/testing/compare_with_cpython/__main__.py +3 -1
- nuitka/tools/testing/measure_construct_performance/__main__.py +1 -8
- nuitka/tools/testing/run_nuitka_tests/__main__.py +77 -11
- nuitka/tools/watch/AutoStage.py +1 -0
- nuitka/tree/Building.py +10 -37
- nuitka/tree/ComplexCallHelperFunctions.py +4 -0
- nuitka/tree/ReformulationAssertStatements.py +31 -14
- nuitka/tree/ReformulationAssignmentStatements.py +5 -1
- nuitka/tree/ReformulationClasses3.py +94 -19
- nuitka/tree/ReformulationDictionaryCreation.py +1 -0
- nuitka/tree/ReformulationFunctionStatements.py +1 -1
- nuitka/tree/ReformulationMatchStatements.py +3 -1
- nuitka/tree/ReformulationYieldExpressions.py +23 -5
- nuitka/utils/CommandLineOptions.py +27 -3
- nuitka/utils/Download.py +2 -2
- nuitka/utils/Execution.py +36 -31
- nuitka/utils/FileOperations.py +18 -39
- nuitka/utils/Hashing.py +5 -1
- nuitka/utils/Importing.py +2 -14
- nuitka/utils/InlineCopies.py +52 -0
- nuitka/utils/InstalledPythons.py +9 -4
- nuitka/utils/Json.py +2 -2
- nuitka/utils/PackageResources.py +44 -0
- nuitka/utils/SharedLibraries.py +24 -0
- nuitka/utils/Signing.py +9 -1
- nuitka/utils/Utils.py +1 -0
- {Nuitka_winsvc-2.4.11.data → Nuitka_winsvc-2.5.6.data}/scripts/nuitka-run.cmd +0 -0
- {Nuitka_winsvc-2.4.11.data → Nuitka_winsvc-2.5.6.data}/scripts/nuitka.cmd +0 -0
- {Nuitka_winsvc-2.4.11.dist-info → Nuitka_winsvc-2.5.6.dist-info}/LICENSE.txt +0 -0
- {Nuitka_winsvc-2.4.11.dist-info → Nuitka_winsvc-2.5.6.dist-info}/entry_points.txt +0 -0
- {Nuitka_winsvc-2.4.11.dist-info → Nuitka_winsvc-2.5.6.dist-info}/top_level.txt +0 -0
nuitka/freezer/Standalone.py
CHANGED
|
@@ -116,6 +116,7 @@ def _detectBinaryDLLs(
|
|
|
116
116
|
original_filename,
|
|
117
117
|
binary_filename,
|
|
118
118
|
package_name,
|
|
119
|
+
use_path,
|
|
119
120
|
use_cache,
|
|
120
121
|
update_cache,
|
|
121
122
|
):
|
|
@@ -142,6 +143,7 @@ def _detectBinaryDLLs(
|
|
|
142
143
|
original_dir=os.path.dirname(original_filename),
|
|
143
144
|
binary_filename=binary_filename,
|
|
144
145
|
package_name=package_name,
|
|
146
|
+
use_path=use_path,
|
|
145
147
|
use_cache=use_cache,
|
|
146
148
|
update_cache=update_cache,
|
|
147
149
|
)
|
|
@@ -228,7 +230,11 @@ def copyDllsUsed(dist_dir, standalone_entry_points):
|
|
|
228
230
|
)
|
|
229
231
|
|
|
230
232
|
|
|
231
|
-
|
|
233
|
+
_excluded_system_dlls = set()
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
def _reduceToPythonPath(used_dll_paths):
|
|
237
|
+
"""Remove DLLs outside of python path."""
|
|
232
238
|
inside_paths = getPythonUnpackedSearchPath()
|
|
233
239
|
|
|
234
240
|
if isAnacondaPython():
|
|
@@ -246,22 +252,58 @@ def _reduceToPythonPath(used_dlls):
|
|
|
246
252
|
for inside_path in inside_paths
|
|
247
253
|
)
|
|
248
254
|
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
255
|
+
kept_used_dll_paths = OrderedSet()
|
|
256
|
+
removed_dll_paths = OrderedSet()
|
|
257
|
+
|
|
258
|
+
for dll_filename in used_dll_paths:
|
|
259
|
+
if decideInside(dll_filename):
|
|
260
|
+
kept_used_dll_paths.add(dll_filename)
|
|
261
|
+
else:
|
|
262
|
+
if dll_filename not in _excluded_system_dlls:
|
|
263
|
+
_excluded_system_dlls.add(dll_filename)
|
|
264
|
+
inclusion_logger.info("Not including system DLL '%s'" % dll_filename)
|
|
265
|
+
|
|
266
|
+
removed_dll_paths.add(dll_filename)
|
|
267
|
+
|
|
268
|
+
return kept_used_dll_paths, removed_dll_paths
|
|
252
269
|
|
|
253
|
-
|
|
270
|
+
|
|
271
|
+
_removed_dll_usages = {}
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
def getRemovedUsedDllsInfo():
|
|
275
|
+
return _removed_dll_usages.items()
|
|
254
276
|
|
|
255
277
|
|
|
256
278
|
def _detectUsedDLLs(standalone_entry_point, source_dir):
|
|
279
|
+
# TODO: We are handling a bunch of cases here, but also some special cases,
|
|
280
|
+
# that should live elsewhere.
|
|
281
|
+
# pylint: disable=too-many-branches,too-many-locals
|
|
282
|
+
|
|
283
|
+
if standalone_entry_point.module_name is not None:
|
|
284
|
+
module_name, module_filename, _kind, finding = locateModule(
|
|
285
|
+
standalone_entry_point.module_name, parent_package=None, level=0
|
|
286
|
+
)
|
|
287
|
+
|
|
288
|
+
# TODO: How can this be None at all.
|
|
289
|
+
if module_filename is not None and isStandardLibraryPath(module_filename):
|
|
290
|
+
allow_outside_dependencies = True
|
|
291
|
+
else:
|
|
292
|
+
allow_outside_dependencies = Plugins.decideAllowOutsideDependencies(
|
|
293
|
+
standalone_entry_point.module_name
|
|
294
|
+
)
|
|
295
|
+
else:
|
|
296
|
+
allow_outside_dependencies = False
|
|
297
|
+
|
|
257
298
|
binary_filename = standalone_entry_point.source_path
|
|
258
299
|
try:
|
|
259
300
|
used_dll_paths = _detectBinaryDLLs(
|
|
260
301
|
is_main_executable=standalone_entry_point.kind == "executable",
|
|
261
302
|
source_dir=source_dir,
|
|
262
303
|
original_filename=standalone_entry_point.source_path,
|
|
263
|
-
binary_filename=
|
|
304
|
+
binary_filename=binary_filename,
|
|
264
305
|
package_name=standalone_entry_point.package_name,
|
|
306
|
+
use_path=allow_outside_dependencies,
|
|
265
307
|
use_cache=not shallNotUseDependsExeCachedResults(),
|
|
266
308
|
update_cache=not shallNotStoreDependsExeCachedResults(),
|
|
267
309
|
)
|
|
@@ -269,6 +311,14 @@ def _detectUsedDLLs(standalone_entry_point, source_dir):
|
|
|
269
311
|
inclusion_logger.info(
|
|
270
312
|
"Not including due to forbidden DLL '%s'." % binary_filename
|
|
271
313
|
)
|
|
314
|
+
except (RuntimeError, Exception) as e:
|
|
315
|
+
inclusion_logger.warning(
|
|
316
|
+
"""\
|
|
317
|
+
Error, cannot detect used DLLs for DLL '%s' in package '%s' due to: %s"""
|
|
318
|
+
% (binary_filename, standalone_entry_point.package_name, str(e))
|
|
319
|
+
)
|
|
320
|
+
|
|
321
|
+
raise
|
|
272
322
|
else:
|
|
273
323
|
# Plugins generally decide if they allow dependencies from the outside
|
|
274
324
|
# based on the package name.
|
|
@@ -284,21 +334,25 @@ def _detectUsedDLLs(standalone_entry_point, source_dir):
|
|
|
284
334
|
), standalone_entry_point.module_name
|
|
285
335
|
assert finding == "absolute", standalone_entry_point.module_name
|
|
286
336
|
|
|
287
|
-
if
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
standalone_entry_point
|
|
292
|
-
|
|
337
|
+
if not allow_outside_dependencies:
|
|
338
|
+
used_dll_paths, removed_dll_paths = _reduceToPythonPath(used_dll_paths)
|
|
339
|
+
|
|
340
|
+
if removed_dll_paths:
|
|
341
|
+
_removed_dll_usages[standalone_entry_point] = (
|
|
342
|
+
"no outside dependencies allowed for '%s'"
|
|
343
|
+
% standalone_entry_point.module_name,
|
|
344
|
+
removed_dll_paths,
|
|
345
|
+
)
|
|
293
346
|
|
|
294
|
-
|
|
295
|
-
|
|
347
|
+
# Lets be sure of this
|
|
348
|
+
assert type(used_dll_paths) is OrderedSet, type(used_dll_paths)
|
|
296
349
|
|
|
297
|
-
# Allow plugins can prevent inclusion, this may discard things from
|
|
350
|
+
# Allow plugins can prevent inclusion, this may discard things from
|
|
351
|
+
# used_dlls through its return value.
|
|
298
352
|
removed_dlls = Plugins.removeDllDependencies(
|
|
299
|
-
dll_filename=binary_filename, dll_filenames=used_dll_paths
|
|
353
|
+
dll_filename=binary_filename, dll_filenames=OrderedSet(used_dll_paths)
|
|
300
354
|
)
|
|
301
|
-
used_dll_paths =
|
|
355
|
+
used_dll_paths = used_dll_paths - removed_dlls
|
|
302
356
|
|
|
303
357
|
for used_dll_path in used_dll_paths:
|
|
304
358
|
extension_standalone_entry_point = getIncludedExtensionModule(used_dll_path)
|
|
@@ -313,7 +367,7 @@ def _detectUsedDLLs(standalone_entry_point, source_dir):
|
|
|
313
367
|
"openvino",
|
|
314
368
|
"av",
|
|
315
369
|
)
|
|
316
|
-
and areInSamePaths(
|
|
370
|
+
and areInSamePaths(binary_filename, used_dll_path)
|
|
317
371
|
):
|
|
318
372
|
# TODO: If used by a DLL from the same folder, put it there,
|
|
319
373
|
# otherwise top level, but for now this is limited to a few cases
|
nuitka/importing/Importing.py
CHANGED
|
@@ -36,7 +36,11 @@ from nuitka.PythonVersions import python_version
|
|
|
36
36
|
from nuitka.Tracing import my_print, recursion_logger
|
|
37
37
|
from nuitka.tree.ReformulationMultidist import locateMultidistModule
|
|
38
38
|
from nuitka.utils.AppDirs import getCacheDir
|
|
39
|
-
from nuitka.utils.FileOperations import
|
|
39
|
+
from nuitka.utils.FileOperations import (
|
|
40
|
+
getNormalizedPath,
|
|
41
|
+
listDir,
|
|
42
|
+
removeDirectory,
|
|
43
|
+
)
|
|
40
44
|
from nuitka.utils.Hashing import getFileContentsHash
|
|
41
45
|
from nuitka.utils.Importing import (
|
|
42
46
|
builtin_module_names,
|
|
@@ -826,10 +830,10 @@ def locateModule(module_name, parent_package, level):
|
|
|
826
830
|
|
|
827
831
|
assert module_package is None or (
|
|
828
832
|
type(module_package) is ModuleName and module_package != ""
|
|
829
|
-
),
|
|
833
|
+
), ("Must not attempt to locate %r" % module_name)
|
|
830
834
|
|
|
831
835
|
if module_filename is not None:
|
|
832
|
-
module_filename =
|
|
836
|
+
module_filename = getNormalizedPath(module_filename)
|
|
833
837
|
|
|
834
838
|
module_name, module_kind = getModuleNameAndKindFromFilename(module_filename)
|
|
835
839
|
module_name = ModuleName.makeModuleNameInPackage(module_name, module_package)
|
|
@@ -874,7 +878,7 @@ def decideModuleSourceRef(filename, module_name, is_main, is_fake, logger):
|
|
|
874
878
|
is_package = False
|
|
875
879
|
|
|
876
880
|
if is_main and os.path.isdir(filename):
|
|
877
|
-
source_filename = os.path.join(filename, "__main__.py")
|
|
881
|
+
source_filename = getNormalizedPath(os.path.join(filename, "__main__.py"))
|
|
878
882
|
|
|
879
883
|
if not os.path.isfile(source_filename):
|
|
880
884
|
sys.stderr.write(
|
|
@@ -904,7 +908,7 @@ def decideModuleSourceRef(filename, module_name, is_main, is_fake, logger):
|
|
|
904
908
|
elif isPackageDir(filename):
|
|
905
909
|
is_package = True
|
|
906
910
|
|
|
907
|
-
source_filename = os.path.join(filename, "__init__.py")
|
|
911
|
+
source_filename = getNormalizedPath(os.path.join(filename, "__init__.py"))
|
|
908
912
|
|
|
909
913
|
if not os.path.isfile(source_filename):
|
|
910
914
|
source_ref = SourceCodeReferences.fromFilename(
|
|
@@ -913,7 +917,7 @@ def decideModuleSourceRef(filename, module_name, is_main, is_fake, logger):
|
|
|
913
917
|
is_namespace = True
|
|
914
918
|
else:
|
|
915
919
|
source_ref = SourceCodeReferences.fromFilename(
|
|
916
|
-
filename=os.path.abspath(source_filename)
|
|
920
|
+
filename=getNormalizedPath(os.path.abspath(source_filename))
|
|
917
921
|
)
|
|
918
922
|
|
|
919
923
|
else:
|
|
@@ -1042,6 +1046,7 @@ _stdlib_module_raises = {
|
|
|
1042
1046
|
"_interpreters": False,
|
|
1043
1047
|
"_interpqueues": False,
|
|
1044
1048
|
"_sysconfig": False,
|
|
1049
|
+
"_suggestions": False,
|
|
1045
1050
|
}
|
|
1046
1051
|
|
|
1047
1052
|
|
|
@@ -1052,6 +1057,28 @@ def isNonRaisingBuiltinModule(module_name):
|
|
|
1052
1057
|
return _stdlib_module_raises.get(module_name)
|
|
1053
1058
|
|
|
1054
1059
|
|
|
1060
|
+
def _getChildPackageNames(module_name):
|
|
1061
|
+
module_name = ModuleName(module_name)
|
|
1062
|
+
|
|
1063
|
+
_module_name, module_filename, _module_kind, _finding = locateModule(
|
|
1064
|
+
parent_package=None, module_name=module_name, level=0
|
|
1065
|
+
)
|
|
1066
|
+
|
|
1067
|
+
package_dir = module_filename
|
|
1068
|
+
|
|
1069
|
+
for module_info in iter_modules([package_dir]):
|
|
1070
|
+
child_name = module_name.getChildNamed(module_info.name)
|
|
1071
|
+
yield child_name
|
|
1072
|
+
|
|
1073
|
+
if module_info.ispkg:
|
|
1074
|
+
for sub_module_name in getChildPackageNames(child_name):
|
|
1075
|
+
yield sub_module_name
|
|
1076
|
+
|
|
1077
|
+
|
|
1078
|
+
def getChildPackageNames(module_name):
|
|
1079
|
+
return tuple(_getChildPackageNames(module_name))
|
|
1080
|
+
|
|
1081
|
+
|
|
1055
1082
|
# Part of "Nuitka", an optimizing Python compiler that is compatible and
|
|
1056
1083
|
# integrates with CPython, but also works on its own.
|
|
1057
1084
|
#
|
nuitka/importing/Recursion.py
CHANGED
|
@@ -339,7 +339,7 @@ def _addIncludedModule(module, package_only):
|
|
|
339
339
|
module_package=module.getFullName(),
|
|
340
340
|
package_only=False,
|
|
341
341
|
)
|
|
342
|
-
elif
|
|
342
|
+
elif sub_filename.endswith(".py"):
|
|
343
343
|
checkPluginSinglePath(
|
|
344
344
|
sub_path,
|
|
345
345
|
module_package=module.getFullName(),
|
|
@@ -347,7 +347,10 @@ def _addIncludedModule(module, package_only):
|
|
|
347
347
|
)
|
|
348
348
|
else:
|
|
349
349
|
for suffix in getSharedLibrarySuffixes():
|
|
350
|
-
if
|
|
350
|
+
if (
|
|
351
|
+
sub_filename.endswith(suffix)
|
|
352
|
+
and "." not in sub_filename[: -len(suffix)]
|
|
353
|
+
):
|
|
351
354
|
checkPluginSinglePath(
|
|
352
355
|
sub_path,
|
|
353
356
|
module_package=module.getFullName(),
|
|
@@ -141,53 +141,55 @@ def isStandardLibraryPath(filename):
|
|
|
141
141
|
return _is_standard_library_path_cache[filename]
|
|
142
142
|
|
|
143
143
|
|
|
144
|
-
# Some modules we want to exclude entirely.
|
|
145
|
-
_excluded_stdlib_modules = ["__main__.py", "__init__.py", "antigravity.py"]
|
|
146
|
-
|
|
147
|
-
if not isWin32Windows():
|
|
148
|
-
# On posix systems, and posix Python variants on Windows, this won't
|
|
149
|
-
# work.
|
|
150
|
-
_excluded_stdlib_modules.append("wintypes.py")
|
|
151
|
-
_excluded_stdlib_modules.append("cp65001.py")
|
|
152
|
-
|
|
153
|
-
|
|
154
144
|
def scanStandardLibraryPath(stdlib_dir):
|
|
155
145
|
# There is a lot of filtering here, done in branches, so there is many of
|
|
156
|
-
# them, but that's acceptable, pylint: disable=too-many-branches
|
|
146
|
+
# them, but that's acceptable, pylint: disable=too-many-branches
|
|
157
147
|
|
|
158
148
|
for root, dirs, filenames in os.walk(stdlib_dir):
|
|
159
149
|
import_path = root[len(stdlib_dir) :].strip("/\\")
|
|
160
150
|
import_path = import_path.replace("\\", ".").replace("/", ".")
|
|
161
151
|
|
|
152
|
+
def _removeFilenamesIfPresent(*remove_filenames):
|
|
153
|
+
# pylint: intended for loop usage, pylint: disable=cell-var-from-loop
|
|
154
|
+
for remove_filename in remove_filenames:
|
|
155
|
+
if remove_filename in filenames:
|
|
156
|
+
filenames.remove(remove_filename)
|
|
157
|
+
|
|
158
|
+
def _removeDirsIfPresent(*remove_dirs):
|
|
159
|
+
# pylint: intended for loop usage, pylint: disable=cell-var-from-loop
|
|
160
|
+
for remove_dir in remove_dirs:
|
|
161
|
+
if remove_dir in dirs:
|
|
162
|
+
dirs.remove(remove_dir)
|
|
163
|
+
|
|
164
|
+
_removeDirsIfPresent("__pycache__")
|
|
165
|
+
|
|
166
|
+
# Ignore ".idea", ".git" and similar folders, they are not modules
|
|
167
|
+
dirs[:] = [dirname for dirname in dirs if not dirname.startswith(".")]
|
|
168
|
+
|
|
162
169
|
if import_path == "":
|
|
163
|
-
|
|
164
|
-
dirs.remove("site-packages")
|
|
165
|
-
if "dist-packages" in dirs:
|
|
166
|
-
dirs.remove("dist-packages")
|
|
167
|
-
if "vendor-packages" in dirs:
|
|
168
|
-
dirs.remove("vendor-packages")
|
|
169
|
-
if "test" in dirs:
|
|
170
|
-
dirs.remove("test")
|
|
171
|
-
if "turtledemo" in dirs:
|
|
172
|
-
dirs.remove("turtledemo")
|
|
173
|
-
|
|
174
|
-
if "ensurepip" in filenames:
|
|
175
|
-
filenames.remove("ensurepip")
|
|
176
|
-
if "ensurepip" in dirs:
|
|
177
|
-
dirs.remove("ensurepip")
|
|
178
|
-
|
|
179
|
-
if "_ios_support.py" in filenames and not isMacOS():
|
|
180
|
-
filenames.remove("_ios_support.py")
|
|
181
|
-
|
|
182
|
-
# Ignore "lib-dynload" and "lib-tk" and alike.
|
|
170
|
+
# Ignore "lib-dynload" and "lib-tk" and alike, spell-checker: ignore dynload
|
|
183
171
|
dirs[:] = [
|
|
184
172
|
dirname
|
|
185
173
|
for dirname in dirs
|
|
186
174
|
if not dirname.startswith("lib-")
|
|
187
|
-
if dirname != "Tools"
|
|
188
175
|
if not dirname.startswith("plat-")
|
|
189
176
|
]
|
|
190
177
|
|
|
178
|
+
_removeDirsIfPresent(
|
|
179
|
+
"site-packages",
|
|
180
|
+
"dist-packages",
|
|
181
|
+
"vendor-packages",
|
|
182
|
+
"test",
|
|
183
|
+
"ensurepip",
|
|
184
|
+
"turtledemo",
|
|
185
|
+
"Tools",
|
|
186
|
+
)
|
|
187
|
+
_removeFilenamesIfPresent("ensurepip")
|
|
188
|
+
|
|
189
|
+
if not isMacOS():
|
|
190
|
+
_removeFilenamesIfPresent("_ios_support.py")
|
|
191
|
+
|
|
192
|
+
# Ignore tests from selected packages, spell-checker: ignore bsddb
|
|
191
193
|
if import_path in (
|
|
192
194
|
"tkinter",
|
|
193
195
|
"Tkinter",
|
|
@@ -199,38 +201,40 @@ def scanStandardLibraryPath(stdlib_dir):
|
|
|
199
201
|
"email",
|
|
200
202
|
"bsddb",
|
|
201
203
|
):
|
|
202
|
-
|
|
203
|
-
|
|
204
|
+
_removeDirsIfPresent("test")
|
|
205
|
+
|
|
206
|
+
if import_path in ("lib2to3", "json", "distutils"):
|
|
207
|
+
_removeDirsIfPresent("tests")
|
|
204
208
|
|
|
205
209
|
if import_path == "distutils.command":
|
|
206
210
|
# Misbehaving and crashing while importing the world.
|
|
207
|
-
|
|
208
|
-
filenames.remove("bdist_conda.py")
|
|
209
|
-
|
|
210
|
-
if import_path in ("lib2to3", "json", "distutils"):
|
|
211
|
-
if "tests" in dirs:
|
|
212
|
-
dirs.remove("tests")
|
|
211
|
+
_removeFilenamesIfPresent("bdist_conda.py")
|
|
213
212
|
|
|
214
213
|
if import_path == "asyncio":
|
|
215
|
-
|
|
216
|
-
filenames.remove("test_utils.py")
|
|
214
|
+
_removeFilenamesIfPresent("test_utils.py")
|
|
217
215
|
|
|
218
|
-
if python_version >=
|
|
216
|
+
if python_version >= 0x300 and isPosixWindows():
|
|
219
217
|
if import_path == "multiprocessing":
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
218
|
+
_removeFilenamesIfPresent(
|
|
219
|
+
"popen_fork.py", "popen_forkserver.py", "popen_spawn_posix.py"
|
|
220
|
+
)
|
|
223
221
|
|
|
224
|
-
if python_version >= 0x300 and isPosixWindows():
|
|
225
222
|
if import_path == "curses":
|
|
226
|
-
|
|
223
|
+
_removeFilenamesIfPresent("has_key.py")
|
|
227
224
|
|
|
228
225
|
if isNetBSD():
|
|
229
226
|
if import_path == "xml.sax":
|
|
230
|
-
|
|
227
|
+
_removeFilenamesIfPresent("expatreader.py")
|
|
228
|
+
|
|
229
|
+
_removeFilenamesIfPresent("__main__.py", "__init__.py", "antigravity.py")
|
|
230
|
+
|
|
231
|
+
if not isWin32Windows():
|
|
232
|
+
# On POSIX systems, and on POSIX Python variants on Windows, this
|
|
233
|
+
# won't work.
|
|
234
|
+
_removeFilenamesIfPresent("wintypes.py", "cp65001.py")
|
|
231
235
|
|
|
232
236
|
for filename in filenames:
|
|
233
|
-
if filename.endswith(".py")
|
|
237
|
+
if filename.endswith(".py"):
|
|
234
238
|
module_name = filename[:-3]
|
|
235
239
|
|
|
236
240
|
if import_path == "":
|
|
@@ -238,13 +242,6 @@ def scanStandardLibraryPath(stdlib_dir):
|
|
|
238
242
|
else:
|
|
239
243
|
yield ModuleName(import_path + "." + module_name)
|
|
240
244
|
|
|
241
|
-
if python_version >= 0x300:
|
|
242
|
-
if "__pycache__" in dirs:
|
|
243
|
-
dirs.remove("__pycache__")
|
|
244
|
-
|
|
245
|
-
# Ignore ".idea", ".git" and similar folders, they are not modules
|
|
246
|
-
dirs[:] = [dirname for dirname in dirs if not dirname.startswith(".")]
|
|
247
|
-
|
|
248
245
|
for dirname in dirs:
|
|
249
246
|
if import_path == "":
|
|
250
247
|
yield ModuleName(dirname)
|
|
@@ -255,6 +252,7 @@ def scanStandardLibraryPath(stdlib_dir):
|
|
|
255
252
|
_stdlib_no_auto_inclusion_list = (
|
|
256
253
|
# Avoid this to be included, implicit usages will be rare, but it triggers
|
|
257
254
|
# the Nuitka plugin "multiprocessing" that is always enabled.
|
|
255
|
+
# spell-checker: ignore _pydecimal,_posixsubprocess,pyexpat,sitecustomize
|
|
258
256
|
"multiprocessing",
|
|
259
257
|
"_multiprocessing",
|
|
260
258
|
# Implicit usages of these will be rare, but it can have that costly extension module
|
|
@@ -369,13 +367,13 @@ _stdlib_no_auto_inclusion_list = (
|
|
|
369
367
|
"py_compile",
|
|
370
368
|
"msilib",
|
|
371
369
|
"_opcode",
|
|
372
|
-
#
|
|
370
|
+
# time zone data is not always needed
|
|
373
371
|
"zoneinfo",
|
|
374
372
|
# tkinter under all its names
|
|
375
373
|
"Tkinter",
|
|
376
374
|
"tkinter",
|
|
377
375
|
"_tkinter",
|
|
378
|
-
# lib-tk from Python2
|
|
376
|
+
# lib-tk from Python2, spell-checker: ignore Tkdnd,Tkconstants
|
|
379
377
|
"Tix",
|
|
380
378
|
"FixTk",
|
|
381
379
|
"ScrolledText",
|
nuitka/nodes/AsyncgenNodes.py
CHANGED
|
@@ -76,14 +76,11 @@ class ExpressionAsyncgenObjectBody(ExpressionFunctionEntryPointBase):
|
|
|
76
76
|
def getFunctionName(self):
|
|
77
77
|
return self.name
|
|
78
78
|
|
|
79
|
-
def markAsNeedsGeneratorReturnHandling(self
|
|
80
|
-
self.needs_generator_return_exit =
|
|
81
|
-
|
|
82
|
-
def needsGeneratorReturnHandling(self):
|
|
83
|
-
return self.needs_generator_return_exit == 2
|
|
79
|
+
def markAsNeedsGeneratorReturnHandling(self):
|
|
80
|
+
self.needs_generator_return_exit = True
|
|
84
81
|
|
|
85
82
|
def needsGeneratorReturnExit(self):
|
|
86
|
-
return
|
|
83
|
+
return self.needs_generator_return_exit
|
|
87
84
|
|
|
88
85
|
@staticmethod
|
|
89
86
|
def needsCreation():
|
|
@@ -20,7 +20,7 @@ from .NodeMakingHelpers import (
|
|
|
20
20
|
makeRaiseTypeErrorExceptionReplacementFromTemplateAndValue,
|
|
21
21
|
wrapExpressionWithSideEffects,
|
|
22
22
|
)
|
|
23
|
-
from .shapes.
|
|
23
|
+
from .shapes.IteratorShapes import tshape_iterator
|
|
24
24
|
from .StatementBasesGenerated import (
|
|
25
25
|
StatementSpecialUnpackCheckBase,
|
|
26
26
|
StatementSpecialUnpackCheckFromIteratedBase,
|
|
@@ -155,7 +155,7 @@ class ExpressionBuiltinIterForUnpack(ExpressionBuiltinIter1):
|
|
|
155
155
|
# Rewrite exceptions to correct message.
|
|
156
156
|
if (
|
|
157
157
|
result_node.isExpressionRaiseException()
|
|
158
|
-
and result_node.subnode_exception_type.
|
|
158
|
+
and result_node.subnode_exception_type.isExpressionBuiltinMakeException()
|
|
159
159
|
and result_node.subnode_exception_type.getExceptionName() == "TypeError"
|
|
160
160
|
):
|
|
161
161
|
return makeRaiseTypeErrorExceptionReplacementFromTemplateAndValue(
|
nuitka/nodes/BuiltinRefNodes.py
CHANGED
|
@@ -18,15 +18,10 @@ from nuitka.Builtins import (
|
|
|
18
18
|
builtin_type_names,
|
|
19
19
|
)
|
|
20
20
|
from nuitka.Options import hasPythonFlagNoAsserts
|
|
21
|
-
from nuitka.PythonVersions import python_version
|
|
22
21
|
from nuitka.specs import BuiltinParameterSpecs
|
|
23
22
|
|
|
24
23
|
from .ConstantRefNodes import makeConstantRefNode
|
|
25
|
-
from .ExceptionNodes import
|
|
26
|
-
ExpressionBuiltinMakeException,
|
|
27
|
-
ExpressionBuiltinMakeExceptionImportError,
|
|
28
|
-
ExpressionBuiltinMakeExceptionModuleNotFoundError,
|
|
29
|
-
)
|
|
24
|
+
from .ExceptionNodes import makeBuiltinMakeExceptionNode
|
|
30
25
|
from .ExpressionBases import (
|
|
31
26
|
CompileTimeConstantExpressionBase,
|
|
32
27
|
ExpressionBase,
|
|
@@ -267,33 +262,22 @@ class ExpressionBuiltinExceptionRef(ExpressionBuiltinRefBase):
|
|
|
267
262
|
def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):
|
|
268
263
|
exception_name = self.getExceptionName()
|
|
269
264
|
|
|
270
|
-
def
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
path=path,
|
|
283
|
-
source_ref=source_ref,
|
|
284
|
-
)
|
|
285
|
-
else:
|
|
286
|
-
# We expect to only get the star arguments for these.
|
|
287
|
-
assert name is None
|
|
288
|
-
assert path is None
|
|
289
|
-
|
|
290
|
-
return ExpressionBuiltinMakeException(
|
|
291
|
-
exception_name=exception_name, args=args, source_ref=source_ref
|
|
292
|
-
)
|
|
265
|
+
def createBuiltinMakeExceptionNode(
|
|
266
|
+
args, name=None, path=None, obj=None, source_ref=None
|
|
267
|
+
):
|
|
268
|
+
return makeBuiltinMakeExceptionNode(
|
|
269
|
+
exception_name=exception_name,
|
|
270
|
+
args=args,
|
|
271
|
+
name=name,
|
|
272
|
+
path=path,
|
|
273
|
+
obj=obj,
|
|
274
|
+
for_raise=False,
|
|
275
|
+
source_ref=source_ref,
|
|
276
|
+
)
|
|
293
277
|
|
|
294
278
|
new_node = BuiltinParameterSpecs.extractBuiltinArgs(
|
|
295
279
|
node=call_node,
|
|
296
|
-
builtin_class=
|
|
280
|
+
builtin_class=createBuiltinMakeExceptionNode,
|
|
297
281
|
builtin_spec=BuiltinParameterSpecs.makeBuiltinExceptionParameterSpec(
|
|
298
282
|
exception_name=exception_name
|
|
299
283
|
),
|