Nuitka-winsvc 2.7.7__cp313-cp313-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/Builtins.py +259 -0
- nuitka/BytecodeCaching.py +184 -0
- nuitka/Bytecodes.py +109 -0
- nuitka/CacheCleanup.py +54 -0
- nuitka/Constants.py +425 -0
- nuitka/Errors.py +93 -0
- nuitka/HardImportRegistry.py +408 -0
- nuitka/MainControl.py +1201 -0
- nuitka/ModuleRegistry.py +364 -0
- nuitka/OptionParsing.py +2473 -0
- nuitka/Options.py +2948 -0
- nuitka/OutputDirectories.py +201 -0
- nuitka/PostProcessing.py +551 -0
- nuitka/Progress.py +252 -0
- nuitka/PythonFlavors.py +426 -0
- nuitka/PythonOperators.py +146 -0
- nuitka/PythonVersions.py +513 -0
- nuitka/Serialization.py +291 -0
- nuitka/SourceCodeReferences.py +176 -0
- nuitka/Tracing.py +579 -0
- nuitka/TreeXML.py +141 -0
- nuitka/Variables.py +515 -0
- nuitka/Version.py +88 -0
- nuitka/__init__.py +19 -0
- nuitka/__main__.py +224 -0
- nuitka/__past__.py +217 -0
- nuitka/build/Backend.scons +1111 -0
- nuitka/build/CCompilerVersion.scons +281 -0
- nuitka/build/DataComposerInterface.py +116 -0
- nuitka/build/Offsets.scons +626 -0
- nuitka/build/Onefile.scons +564 -0
- nuitka/build/SconsCaching.py +451 -0
- nuitka/build/SconsCompilerSettings.py +1133 -0
- nuitka/build/SconsHacks.py +215 -0
- nuitka/build/SconsInterface.py +664 -0
- nuitka/build/SconsProgress.py +100 -0
- nuitka/build/SconsSpawn.py +436 -0
- nuitka/build/SconsUtils.py +939 -0
- nuitka/build/__init__.py +19 -0
- nuitka/build/include/nuitka/allocator.h +450 -0
- nuitka/build/include/nuitka/builtins.h +97 -0
- nuitka/build/include/nuitka/calling.h +123 -0
- nuitka/build/include/nuitka/checkers.h +39 -0
- nuitka/build/include/nuitka/checksum_tools.h +28 -0
- nuitka/build/include/nuitka/compiled_asyncgen.h +281 -0
- nuitka/build/include/nuitka/compiled_cell.h +64 -0
- nuitka/build/include/nuitka/compiled_coroutine.h +271 -0
- nuitka/build/include/nuitka/compiled_frame.h +502 -0
- nuitka/build/include/nuitka/compiled_function.h +170 -0
- nuitka/build/include/nuitka/compiled_generator.h +287 -0
- nuitka/build/include/nuitka/compiled_method.h +54 -0
- nuitka/build/include/nuitka/constants.h +251 -0
- nuitka/build/include/nuitka/constants_blob.h +34 -0
- nuitka/build/include/nuitka/debug_settings.h +60 -0
- nuitka/build/include/nuitka/environment_variables.h +30 -0
- nuitka/build/include/nuitka/environment_variables_system.h +51 -0
- nuitka/build/include/nuitka/exception_groups.h +167 -0
- nuitka/build/include/nuitka/exceptions.h +1458 -0
- nuitka/build/include/nuitka/filesystem_paths.h +117 -0
- nuitka/build/include/nuitka/freelists.h +92 -0
- nuitka/build/include/nuitka/hedley.h +1774 -0
- nuitka/build/include/nuitka/helper/attributes.h +90 -0
- nuitka/build/include/nuitka/helper/boolean.h +86 -0
- nuitka/build/include/nuitka/helper/bytearrays.h +34 -0
- nuitka/build/include/nuitka/helper/bytes.h +28 -0
- nuitka/build/include/nuitka/helper/calling_generated.h +132 -0
- 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/comparisons_eq.h +247 -0
- nuitka/build/include/nuitka/helper/comparisons_ge.h +197 -0
- nuitka/build/include/nuitka/helper/comparisons_gt.h +197 -0
- nuitka/build/include/nuitka/helper/comparisons_le.h +247 -0
- nuitka/build/include/nuitka/helper/comparisons_lt.h +247 -0
- nuitka/build/include/nuitka/helper/comparisons_ne.h +197 -0
- nuitka/build/include/nuitka/helper/complex.h +46 -0
- nuitka/build/include/nuitka/helper/dictionaries.h +481 -0
- nuitka/build/include/nuitka/helper/floats.h +32 -0
- nuitka/build/include/nuitka/helper/import_hard.h +121 -0
- nuitka/build/include/nuitka/helper/indexes.h +47 -0
- nuitka/build/include/nuitka/helper/ints.h +165 -0
- nuitka/build/include/nuitka/helper/iterators.h +376 -0
- nuitka/build/include/nuitka/helper/lists.h +94 -0
- nuitka/build/include/nuitka/helper/lists_generated.h +36 -0
- nuitka/build/include/nuitka/helper/mappings.h +39 -0
- nuitka/build/include/nuitka/helper/operations.h +114 -0
- nuitka/build/include/nuitka/helper/operations_binary_add.h +240 -0
- nuitka/build/include/nuitka/helper/operations_binary_bitand.h +108 -0
- nuitka/build/include/nuitka/helper/operations_binary_bitor.h +108 -0
- nuitka/build/include/nuitka/helper/operations_binary_bitxor.h +108 -0
- nuitka/build/include/nuitka/helper/operations_binary_divmod.h +103 -0
- nuitka/build/include/nuitka/helper/operations_binary_dual_add.h +34 -0
- nuitka/build/include/nuitka/helper/operations_binary_floordiv.h +103 -0
- nuitka/build/include/nuitka/helper/operations_binary_lshift.h +99 -0
- nuitka/build/include/nuitka/helper/operations_binary_matmult.h +60 -0
- nuitka/build/include/nuitka/helper/operations_binary_mod.h +304 -0
- nuitka/build/include/nuitka/helper/operations_binary_mult.h +247 -0
- nuitka/build/include/nuitka/helper/operations_binary_olddiv.h +125 -0
- nuitka/build/include/nuitka/helper/operations_binary_pow.h +90 -0
- nuitka/build/include/nuitka/helper/operations_binary_rshift.h +99 -0
- nuitka/build/include/nuitka/helper/operations_binary_sub.h +117 -0
- nuitka/build/include/nuitka/helper/operations_binary_truediv.h +103 -0
- nuitka/build/include/nuitka/helper/operations_builtin_types.h +247 -0
- nuitka/build/include/nuitka/helper/operations_inplace_add.h +173 -0
- nuitka/build/include/nuitka/helper/operations_inplace_bitand.h +76 -0
- nuitka/build/include/nuitka/helper/operations_inplace_bitor.h +76 -0
- nuitka/build/include/nuitka/helper/operations_inplace_bitxor.h +76 -0
- nuitka/build/include/nuitka/helper/operations_inplace_floordiv.h +95 -0
- nuitka/build/include/nuitka/helper/operations_inplace_lshift.h +62 -0
- nuitka/build/include/nuitka/helper/operations_inplace_matmult.h +60 -0
- nuitka/build/include/nuitka/helper/operations_inplace_mod.h +218 -0
- nuitka/build/include/nuitka/helper/operations_inplace_mult.h +184 -0
- nuitka/build/include/nuitka/helper/operations_inplace_olddiv.h +115 -0
- nuitka/build/include/nuitka/helper/operations_inplace_pow.h +87 -0
- nuitka/build/include/nuitka/helper/operations_inplace_rshift.h +62 -0
- nuitka/build/include/nuitka/helper/operations_inplace_sub.h +102 -0
- nuitka/build/include/nuitka/helper/operations_inplace_truediv.h +95 -0
- nuitka/build/include/nuitka/helper/raising.h +114 -0
- nuitka/build/include/nuitka/helper/rangeobjects.h +66 -0
- nuitka/build/include/nuitka/helper/richcomparisons.h +35 -0
- nuitka/build/include/nuitka/helper/sequences.h +33 -0
- nuitka/build/include/nuitka/helper/sets.h +25 -0
- nuitka/build/include/nuitka/helper/slices.h +314 -0
- nuitka/build/include/nuitka/helper/strings.h +30 -0
- nuitka/build/include/nuitka/helper/subscripts.h +390 -0
- nuitka/build/include/nuitka/helper/tuples.h +187 -0
- nuitka/build/include/nuitka/helpers.h +417 -0
- nuitka/build/include/nuitka/importing.h +149 -0
- nuitka/build/include/nuitka/incbin.h +402 -0
- nuitka/build/include/nuitka/jit_sources.h +25 -0
- nuitka/build/include/nuitka/prelude.h +626 -0
- nuitka/build/include/nuitka/printing.h +84 -0
- nuitka/build/include/nuitka/python_pgo.h +57 -0
- nuitka/build/include/nuitka/safe_string_ops.h +57 -0
- nuitka/build/include/nuitka/threading.h +142 -0
- nuitka/build/include/nuitka/tracing.h +82 -0
- nuitka/build/include/nuitka/type_aliases.h +30 -0
- nuitka/build/include/nuitka/unfreezing.h +91 -0
- nuitka/build/inline_copy/appdirs/LICENSE.txt +23 -0
- nuitka/build/inline_copy/appdirs/appdirs.py +611 -0
- nuitka/build/inline_copy/atomicwrites/LICENSE +19 -0
- nuitka/build/inline_copy/atomicwrites/atomicwrites.py +226 -0
- nuitka/build/inline_copy/bin/scons.py +58 -0
- nuitka/build/inline_copy/clcache/clcache/LICENSE +30 -0
- nuitka/build/inline_copy/clcache/clcache/__init__.py +4 -0
- nuitka/build/inline_copy/clcache/clcache/caching.py +2008 -0
- nuitka/build/inline_copy/colorama/LICENSE.txt +27 -0
- nuitka/build/inline_copy/colorama/colorama/__init__.py +6 -0
- nuitka/build/inline_copy/colorama/colorama/ansi.py +102 -0
- nuitka/build/inline_copy/colorama/colorama/ansitowin32.py +258 -0
- nuitka/build/inline_copy/colorama/colorama/initialise.py +80 -0
- nuitka/build/inline_copy/colorama/colorama/win32.py +152 -0
- nuitka/build/inline_copy/colorama/colorama/winterm.py +169 -0
- nuitka/build/inline_copy/glob2/LICENSE +27 -0
- nuitka/build/inline_copy/glob2/glob2/__init__.py +5 -0
- nuitka/build/inline_copy/glob2/glob2/compat.py +167 -0
- nuitka/build/inline_copy/glob2/glob2/fnmatch.py +141 -0
- nuitka/build/inline_copy/glob2/glob2/impl.py +216 -0
- nuitka/build/inline_copy/jinja2/LICENSE.rst +28 -0
- nuitka/build/inline_copy/jinja2/README.rst +2 -0
- nuitka/build/inline_copy/jinja2/jinja2/__init__.py +72 -0
- nuitka/build/inline_copy/jinja2/jinja2/_compat.py +105 -0
- nuitka/build/inline_copy/jinja2/jinja2/_identifier.py +2 -0
- nuitka/build/inline_copy/jinja2/jinja2/bccache.py +361 -0
- nuitka/build/inline_copy/jinja2/jinja2/compiler.py +1721 -0
- nuitka/build/inline_copy/jinja2/jinja2/constants.py +32 -0
- nuitka/build/inline_copy/jinja2/jinja2/debug.py +378 -0
- nuitka/build/inline_copy/jinja2/jinja2/defaults.py +56 -0
- nuitka/build/inline_copy/jinja2/jinja2/environment.py +1276 -0
- nuitka/build/inline_copy/jinja2/jinja2/exceptions.py +146 -0
- nuitka/build/inline_copy/jinja2/jinja2/ext.py +627 -0
- nuitka/build/inline_copy/jinja2/jinja2/filters.py +1190 -0
- nuitka/build/inline_copy/jinja2/jinja2/idtracking.py +286 -0
- nuitka/build/inline_copy/jinja2/jinja2/lexer.py +739 -0
- nuitka/build/inline_copy/jinja2/jinja2/loaders.py +483 -0
- nuitka/build/inline_copy/jinja2/jinja2/meta.py +106 -0
- nuitka/build/inline_copy/jinja2/jinja2/nativetypes.py +220 -0
- nuitka/build/inline_copy/jinja2/jinja2/nodes.py +999 -0
- nuitka/build/inline_copy/jinja2/jinja2/optimizer.py +49 -0
- nuitka/build/inline_copy/jinja2/jinja2/parser.py +903 -0
- nuitka/build/inline_copy/jinja2/jinja2/runtime.py +808 -0
- nuitka/build/inline_copy/jinja2/jinja2/sandbox.py +488 -0
- nuitka/build/inline_copy/jinja2/jinja2/tests.py +174 -0
- nuitka/build/inline_copy/jinja2/jinja2/utils.py +642 -0
- nuitka/build/inline_copy/jinja2/jinja2/visitor.py +87 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Action.py +1475 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Builder.py +905 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/CacheDir.py +314 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Conftest.py +805 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Debug.py +251 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Defaults.py +646 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Environment.py +2561 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/EnvironmentValues.py +119 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Errors.py +222 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Executor.py +660 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Job.py +439 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Memoize.py +242 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Node/Alias.py +176 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Node/FS.py +3861 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Node/Python.py +195 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Node/__init__.py +1784 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/PathList.py +224 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/__init__.py +341 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/aix.py +81 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/cygwin.py +61 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/darwin.py +70 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/hpux.py +45 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/irix.py +41 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/mingw.py +33 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/os2.py +55 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/posix.py +124 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/sunos.py +47 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/virtualenv.py +115 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/win32.py +429 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/SConf.py +1119 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/SConsign.py +453 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Scanner/C.py +226 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Scanner/Dir.py +131 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Scanner/Prog.py +114 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Scanner/RC.py +57 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Scanner/__init__.py +436 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Script/Interactive.py +372 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Script/Main.py +1469 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Script/SConsOptions.py +1071 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Script/SConscript.py +686 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Script/__init__.py +425 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Subst.py +979 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Taskmaster.py +1062 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/386asm.py +61 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/GettextCommon.py +429 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/__init__.py +52 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/arch.py +66 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/common.py +371 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/netframework.py +83 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/sdk.py +411 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/vc.py +994 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/vs.py +608 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/PharLapCommon.py +116 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/__init__.py +882 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/aixc++.py +43 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/aixcc.py +74 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/aixcxx.py +77 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/aixlink.py +78 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/applelink.py +209 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/ar.py +63 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/as.py +49 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/asm.py +78 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/bcc32.py +81 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/c++.py +44 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/cc.py +105 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/clang.py +91 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/clangCommon/__init__.py +18 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/clangxx.py +99 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/cxx.py +95 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/cyglink.py +212 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/default.py +50 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/filesystem.py +98 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/g++.py +45 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/gas.py +56 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/gcc.py +110 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/gettext_tool.py +69 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/gnulink.py +70 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/gxx.py +78 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/hpc++.py +45 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/hpcc.py +53 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/hpcxx.py +88 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/hplink.py +72 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/icc.py +59 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/icl.py +52 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/ilink.py +55 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/ilink32.py +60 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/install.py +510 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/intelc.py +617 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/link.py +72 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/linkCommon/LoadableModule.py +131 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/linkCommon/SharedLibrary.py +218 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/linkCommon/__init__.py +171 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/linkloc.py +112 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/m4.py +63 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/masm.py +77 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/mingw.py +232 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/msgfmt.py +132 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/msginit.py +137 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/msgmerge.py +125 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/mslib.py +73 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/mslink.py +339 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/mssdk.py +50 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/msvc.py +325 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/msvs.py +2116 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/mwcc.py +207 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/mwld.py +108 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/nasm.py +72 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/rmic.py +139 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/rpcgen.py +70 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sgiar.py +68 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sgic++.py +43 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sgicc.py +53 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sgicxx.py +61 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sgilink.py +59 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sunar.py +64 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sunc++.py +45 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/suncc.py +58 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/suncxx.py +153 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sunlink.py +79 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/tar.py +73 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/textfile.py +198 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/tlib.py +53 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/wix.py +104 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/xgettext.py +337 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/zip.py +120 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Util.py +2134 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Utilities/ConfigureCache.py +171 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Utilities/__init__.py +0 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Utilities/sconsign.py +494 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/BoolVariable.py +96 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/EnumVariable.py +110 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/ListVariable.py +152 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/PackageVariable.py +107 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/PathVariable.py +158 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/__init__.py +334 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Warnings.py +238 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/__init__.py +9 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/compat/__init__.py +104 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/compat/_scons_dbm.py +42 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/compat/win32.py +101 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/cpp.py +640 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/dblite.py +295 -0
- nuitka/build/inline_copy/lib/scons-4.3.0/SCons/exitfuncs.py +59 -0
- nuitka/build/inline_copy/markupsafe/LICENSE.rst +28 -0
- nuitka/build/inline_copy/markupsafe/markupsafe/__init__.py +327 -0
- nuitka/build/inline_copy/markupsafe/markupsafe/_compat.py +33 -0
- nuitka/build/inline_copy/markupsafe/markupsafe/_constants.py +264 -0
- nuitka/build/inline_copy/markupsafe/markupsafe/_native.py +69 -0
- nuitka/build/inline_copy/pefile/LICENSE.txt +21 -0
- nuitka/build/inline_copy/pefile/ordlookup/__init__.py +41 -0
- nuitka/build/inline_copy/pefile/ordlookup/oleaut32.py +400 -0
- nuitka/build/inline_copy/pefile/ordlookup/ws2_32.py +120 -0
- nuitka/build/inline_copy/pefile/pefile.py +8034 -0
- nuitka/build/inline_copy/pkg_resources/pkg_resources/__init__.py +3272 -0
- nuitka/build/inline_copy/pkg_resources/pkg_resources/py31compat.py +21 -0
- nuitka/build/inline_copy/python_hacl/LICENSE.txt +201 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_MD5.c +1430 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_MD5.h +66 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA1.c +463 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA1.h +66 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA2.c +1273 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA2.h +204 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA3.c +734 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA3.h +131 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Streaming_Types.h +83 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/FStar_UInt128_Verified.h +346 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/FStar_UInt_8_16_32_64.h +107 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/fstar_uint128_struct_endianness.h +68 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/internal/target.h +293 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/lowstar_endianness.h +231 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/types.h +14 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_MD5.h +56 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_SHA1.h +56 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_SHA2.h +164 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_SHA3.h +65 -0
- nuitka/build/inline_copy/python_hacl/hacl_312/python_hacl_namespaces.h +89 -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 +484 -0
- nuitka/build/inline_copy/tqdm/tqdm/__init__.py +40 -0
- nuitka/build/inline_copy/tqdm/tqdm/_main.py +9 -0
- nuitka/build/inline_copy/tqdm/tqdm/_monitor.py +97 -0
- nuitka/build/inline_copy/tqdm/tqdm/_tqdm.py +9 -0
- nuitka/build/inline_copy/tqdm/tqdm/_tqdm_notebook.py +9 -0
- nuitka/build/inline_copy/tqdm/tqdm/_tqdm_pandas.py +24 -0
- nuitka/build/inline_copy/tqdm/tqdm/_utils.py +12 -0
- nuitka/build/inline_copy/tqdm/tqdm/auto.py +44 -0
- nuitka/build/inline_copy/tqdm/tqdm/autonotebook.py +28 -0
- nuitka/build/inline_copy/tqdm/tqdm/dask.py +46 -0
- nuitka/build/inline_copy/tqdm/tqdm/notebook.py +316 -0
- nuitka/build/inline_copy/tqdm/tqdm/std.py +1524 -0
- nuitka/build/inline_copy/tqdm/tqdm/tk.py +207 -0
- nuitka/build/inline_copy/tqdm/tqdm/utils.py +351 -0
- nuitka/build/inline_copy/tqdm/tqdm/version.py +2 -0
- nuitka/build/inline_copy/yaml/LICENSE +20 -0
- nuitka/build/inline_copy/yaml/yaml/__init__.py +427 -0
- nuitka/build/inline_copy/yaml/yaml/composer.py +139 -0
- nuitka/build/inline_copy/yaml/yaml/constructor.py +748 -0
- nuitka/build/inline_copy/yaml/yaml/cyaml.py +101 -0
- nuitka/build/inline_copy/yaml/yaml/dumper.py +62 -0
- nuitka/build/inline_copy/yaml/yaml/emitter.py +1137 -0
- nuitka/build/inline_copy/yaml/yaml/error.py +75 -0
- nuitka/build/inline_copy/yaml/yaml/events.py +86 -0
- nuitka/build/inline_copy/yaml/yaml/loader.py +63 -0
- nuitka/build/inline_copy/yaml/yaml/nodes.py +49 -0
- nuitka/build/inline_copy/yaml/yaml/parser.py +589 -0
- nuitka/build/inline_copy/yaml/yaml/reader.py +185 -0
- nuitka/build/inline_copy/yaml/yaml/representer.py +389 -0
- nuitka/build/inline_copy/yaml/yaml/resolver.py +227 -0
- nuitka/build/inline_copy/yaml/yaml/scanner.py +1435 -0
- nuitka/build/inline_copy/yaml/yaml/serializer.py +111 -0
- nuitka/build/inline_copy/yaml/yaml/tokens.py +104 -0
- nuitka/build/inline_copy/zlib/LICENSE +22 -0
- nuitka/build/inline_copy/zlib/crc32.c +1049 -0
- nuitka/build/inline_copy/zlib/crc32.h +9446 -0
- nuitka/build/inline_copy/zlib/zconf.h +551 -0
- nuitka/build/inline_copy/zlib/zlib.h +1938 -0
- nuitka/build/inline_copy/zlib/zutil.h +275 -0
- nuitka/build/inline_copy/zstd/LICENSE.txt +30 -0
- nuitka/build/inline_copy/zstd/common/bitstream.h +463 -0
- nuitka/build/inline_copy/zstd/common/compiler.h +288 -0
- nuitka/build/inline_copy/zstd/common/cpu.h +213 -0
- nuitka/build/inline_copy/zstd/common/debug.h +107 -0
- nuitka/build/inline_copy/zstd/common/entropy_common.c +360 -0
- nuitka/build/inline_copy/zstd/common/error_private.c +56 -0
- nuitka/build/inline_copy/zstd/common/error_private.h +80 -0
- nuitka/build/inline_copy/zstd/common/fse.h +715 -0
- nuitka/build/inline_copy/zstd/common/fse_decompress.c +393 -0
- nuitka/build/inline_copy/zstd/common/huf.h +361 -0
- nuitka/build/inline_copy/zstd/common/mem.h +426 -0
- nuitka/build/inline_copy/zstd/common/xxhash.c +826 -0
- nuitka/build/inline_copy/zstd/common/xxhash.h +285 -0
- nuitka/build/inline_copy/zstd/common/zstd_common.c +83 -0
- nuitka/build/inline_copy/zstd/common/zstd_deps.h +111 -0
- nuitka/build/inline_copy/zstd/common/zstd_errors.h +95 -0
- nuitka/build/inline_copy/zstd/common/zstd_internal.h +478 -0
- nuitka/build/inline_copy/zstd/decompress/huf_decompress.c +1350 -0
- nuitka/build/inline_copy/zstd/decompress/zstd_ddict.c +244 -0
- nuitka/build/inline_copy/zstd/decompress/zstd_ddict.h +44 -0
- nuitka/build/inline_copy/zstd/decompress/zstd_decompress.c +1930 -0
- nuitka/build/inline_copy/zstd/decompress/zstd_decompress_block.c +1540 -0
- nuitka/build/inline_copy/zstd/decompress/zstd_decompress_block.h +62 -0
- nuitka/build/inline_copy/zstd/decompress/zstd_decompress_internal.h +190 -0
- nuitka/build/inline_copy/zstd/zstd.h +2391 -0
- nuitka/build/static_src/CompiledAsyncgenType.c +2211 -0
- nuitka/build/static_src/CompiledCellType.c +300 -0
- nuitka/build/static_src/CompiledCodeHelpers.c +2160 -0
- nuitka/build/static_src/CompiledCoroutineType.c +1946 -0
- nuitka/build/static_src/CompiledFrameType.c +1337 -0
- nuitka/build/static_src/CompiledFunctionType.c +3320 -0
- nuitka/build/static_src/CompiledGeneratorType.c +1997 -0
- nuitka/build/static_src/CompiledGeneratorTypeUncompiledIntegration.c +2117 -0
- nuitka/build/static_src/CompiledMethodType.c +614 -0
- nuitka/build/static_src/GenerateHeadersMain.c +30 -0
- nuitka/build/static_src/HelpersAllocator.c +939 -0
- nuitka/build/static_src/HelpersAttributes.c +1241 -0
- nuitka/build/static_src/HelpersBuiltin.c +901 -0
- nuitka/build/static_src/HelpersBuiltinTypeMethods.c +3594 -0
- nuitka/build/static_src/HelpersBytes.c +107 -0
- nuitka/build/static_src/HelpersCalling.c +397 -0
- nuitka/build/static_src/HelpersCallingGenerated.c +14361 -0
- nuitka/build/static_src/HelpersChecksumTools.c +59 -0
- nuitka/build/static_src/HelpersClasses.c +91 -0
- 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 +12070 -0
- nuitka/build/static_src/HelpersComparisonEqUtils.c +169 -0
- nuitka/build/static_src/HelpersComparisonGe.c +11871 -0
- nuitka/build/static_src/HelpersComparisonGt.c +11855 -0
- nuitka/build/static_src/HelpersComparisonLe.c +11957 -0
- nuitka/build/static_src/HelpersComparisonLt.c +11941 -0
- nuitka/build/static_src/HelpersComparisonNe.c +11979 -0
- nuitka/build/static_src/HelpersConsole.c +124 -0
- nuitka/build/static_src/HelpersConstantsBlob.c +1487 -0
- nuitka/build/static_src/HelpersDeepcopy.c +636 -0
- nuitka/build/static_src/HelpersDictionaries.c +1739 -0
- nuitka/build/static_src/HelpersDictionariesGenerated.c +738 -0
- nuitka/build/static_src/HelpersDumpBacktraces.c +63 -0
- nuitka/build/static_src/HelpersEnvironmentVariables.c +65 -0
- nuitka/build/static_src/HelpersEnvironmentVariablesSystem.c +97 -0
- nuitka/build/static_src/HelpersExceptions.c +298 -0
- nuitka/build/static_src/HelpersFiles.c +353 -0
- nuitka/build/static_src/HelpersFilesystemPaths.c +1322 -0
- nuitka/build/static_src/HelpersFloats.c +92 -0
- nuitka/build/static_src/HelpersHeapStorage.c +68 -0
- nuitka/build/static_src/HelpersImport.c +506 -0
- nuitka/build/static_src/HelpersImportHard.c +526 -0
- nuitka/build/static_src/HelpersJitSources.c +48 -0
- nuitka/build/static_src/HelpersLists.c +899 -0
- nuitka/build/static_src/HelpersListsGenerated.c +564 -0
- nuitka/build/static_src/HelpersMappings.c +46 -0
- nuitka/build/static_src/HelpersMatching.c +192 -0
- nuitka/build/static_src/HelpersOperationBinaryAdd.c +6477 -0
- nuitka/build/static_src/HelpersOperationBinaryAddUtils.c +703 -0
- nuitka/build/static_src/HelpersOperationBinaryBitand.c +2738 -0
- nuitka/build/static_src/HelpersOperationBinaryBitor.c +2738 -0
- nuitka/build/static_src/HelpersOperationBinaryBitxor.c +2738 -0
- nuitka/build/static_src/HelpersOperationBinaryDivmod.c +2406 -0
- nuitka/build/static_src/HelpersOperationBinaryDivmodUtils.c +33 -0
- nuitka/build/static_src/HelpersOperationBinaryDualAdd.c +172 -0
- nuitka/build/static_src/HelpersOperationBinaryFloordiv.c +2422 -0
- nuitka/build/static_src/HelpersOperationBinaryInplaceAdd.c +220 -0
- nuitka/build/static_src/HelpersOperationBinaryLshift.c +2846 -0
- nuitka/build/static_src/HelpersOperationBinaryMatmult.c +453 -0
- nuitka/build/static_src/HelpersOperationBinaryMod.c +6549 -0
- nuitka/build/static_src/HelpersOperationBinaryMult.c +6438 -0
- nuitka/build/static_src/HelpersOperationBinaryMultUtils.c +125 -0
- nuitka/build/static_src/HelpersOperationBinaryOlddiv.c +2355 -0
- nuitka/build/static_src/HelpersOperationBinaryPow.c +2743 -0
- nuitka/build/static_src/HelpersOperationBinaryPowUtils.c +26 -0
- nuitka/build/static_src/HelpersOperationBinaryRshift.c +2706 -0
- nuitka/build/static_src/HelpersOperationBinarySub.c +2649 -0
- nuitka/build/static_src/HelpersOperationBinaryTruediv.c +2415 -0
- nuitka/build/static_src/HelpersOperationInplaceAdd.c +5211 -0
- nuitka/build/static_src/HelpersOperationInplaceAddUtils.c +144 -0
- nuitka/build/static_src/HelpersOperationInplaceBitand.c +1826 -0
- nuitka/build/static_src/HelpersOperationInplaceBitor.c +1826 -0
- nuitka/build/static_src/HelpersOperationInplaceBitxor.c +1826 -0
- nuitka/build/static_src/HelpersOperationInplaceFloordiv.c +2605 -0
- nuitka/build/static_src/HelpersOperationInplaceLshift.c +1594 -0
- nuitka/build/static_src/HelpersOperationInplaceMatmult.c +603 -0
- nuitka/build/static_src/HelpersOperationInplaceMod.c +4762 -0
- nuitka/build/static_src/HelpersOperationInplaceMult.c +4689 -0
- nuitka/build/static_src/HelpersOperationInplaceOlddiv.c +2553 -0
- nuitka/build/static_src/HelpersOperationInplacePow.c +2807 -0
- nuitka/build/static_src/HelpersOperationInplaceRshift.c +1534 -0
- nuitka/build/static_src/HelpersOperationInplaceSub.c +2894 -0
- nuitka/build/static_src/HelpersOperationInplaceTruediv.c +2612 -0
- nuitka/build/static_src/HelpersProfiling.c +104 -0
- nuitka/build/static_src/HelpersPythonPgo.c +113 -0
- nuitka/build/static_src/HelpersRaising.c +447 -0
- nuitka/build/static_src/HelpersSafeStrings.c +185 -0
- nuitka/build/static_src/HelpersSequences.c +134 -0
- nuitka/build/static_src/HelpersSlices.c +73 -0
- nuitka/build/static_src/HelpersStrings.c +998 -0
- nuitka/build/static_src/HelpersTuples.c +148 -0
- nuitka/build/static_src/HelpersTypes.c +329 -0
- nuitka/build/static_src/InspectPatcher.c +439 -0
- nuitka/build/static_src/MainProgram.c +2060 -0
- nuitka/build/static_src/MetaPathBasedLoader.c +2290 -0
- nuitka/build/static_src/MetaPathBasedLoaderImportlibMetadataDistribution.c +125 -0
- nuitka/build/static_src/MetaPathBasedLoaderResourceReader.c +158 -0
- nuitka/build/static_src/MetaPathBasedLoaderResourceReaderFiles.c +785 -0
- nuitka/build/static_src/OnefileBootstrap.c +1580 -0
- nuitka/build/static_src/OnefileSplashScreen.cpp +275 -0
- nuitka/code_generation/AsyncgenCodes.py +186 -0
- nuitka/code_generation/AttributeCodes.py +357 -0
- nuitka/code_generation/BinaryOperationHelperDefinitions.py +720 -0
- nuitka/code_generation/BranchCodes.py +67 -0
- nuitka/code_generation/BuiltinCodes.py +529 -0
- nuitka/code_generation/CallCodes.py +1186 -0
- nuitka/code_generation/ClassCodes.py +156 -0
- nuitka/code_generation/CodeGeneration.py +1078 -0
- nuitka/code_generation/CodeHelperSelection.py +81 -0
- nuitka/code_generation/CodeHelpers.py +455 -0
- nuitka/code_generation/CodeObjectCodes.py +165 -0
- nuitka/code_generation/ComparisonCodes.py +569 -0
- nuitka/code_generation/ComparisonHelperDefinitions.py +146 -0
- nuitka/code_generation/ConditionalCodes.py +236 -0
- nuitka/code_generation/ConstantCodes.py +243 -0
- nuitka/code_generation/Contexts.py +1248 -0
- nuitka/code_generation/CoroutineCodes.py +253 -0
- nuitka/code_generation/CtypesCodes.py +46 -0
- nuitka/code_generation/DictCodes.py +918 -0
- nuitka/code_generation/Emission.py +75 -0
- nuitka/code_generation/ErrorCodes.py +281 -0
- nuitka/code_generation/EvalCodes.py +444 -0
- nuitka/code_generation/ExceptionCodes.py +337 -0
- nuitka/code_generation/ExpressionCTypeSelectionHelpers.py +227 -0
- nuitka/code_generation/ExpressionCodes.py +61 -0
- nuitka/code_generation/FrameCodes.py +518 -0
- nuitka/code_generation/FunctionCodes.py +858 -0
- nuitka/code_generation/GeneratorCodes.py +218 -0
- nuitka/code_generation/GlobalConstants.py +249 -0
- nuitka/code_generation/GlobalsLocalsCodes.py +211 -0
- nuitka/code_generation/IdCodes.py +53 -0
- nuitka/code_generation/ImportCodes.py +468 -0
- nuitka/code_generation/Indentation.py +45 -0
- nuitka/code_generation/IndexCodes.py +50 -0
- nuitka/code_generation/InjectCCodes.py +28 -0
- nuitka/code_generation/IntegerCodes.py +110 -0
- nuitka/code_generation/IteratorCodes.py +378 -0
- nuitka/code_generation/JitCodes.py +44 -0
- nuitka/code_generation/LabelCodes.py +68 -0
- nuitka/code_generation/LineNumberCodes.py +91 -0
- nuitka/code_generation/ListCodes.py +502 -0
- nuitka/code_generation/LoaderCodes.py +193 -0
- nuitka/code_generation/LocalsDictCodes.py +359 -0
- nuitka/code_generation/LoopCodes.py +88 -0
- nuitka/code_generation/MatchCodes.py +67 -0
- nuitka/code_generation/ModuleCodes.py +247 -0
- nuitka/code_generation/Namify.py +260 -0
- nuitka/code_generation/NetworkxCodes.py +51 -0
- nuitka/code_generation/OperationCodes.py +398 -0
- nuitka/code_generation/PackageResourceCodes.py +986 -0
- nuitka/code_generation/PrintCodes.py +93 -0
- nuitka/code_generation/PythonAPICodes.py +215 -0
- nuitka/code_generation/RaisingCodes.py +481 -0
- nuitka/code_generation/Reports.py +115 -0
- nuitka/code_generation/ReturnCodes.py +143 -0
- nuitka/code_generation/SetCodes.py +196 -0
- nuitka/code_generation/SliceCodes.py +465 -0
- nuitka/code_generation/StringCodes.py +303 -0
- nuitka/code_generation/SubscriptCodes.py +263 -0
- nuitka/code_generation/TensorflowCodes.py +54 -0
- nuitka/code_generation/TryCodes.py +326 -0
- nuitka/code_generation/TupleCodes.py +115 -0
- nuitka/code_generation/TypeAliasCodes.py +120 -0
- nuitka/code_generation/VariableCodes.py +519 -0
- nuitka/code_generation/VariableDeclarations.py +279 -0
- nuitka/code_generation/YieldCodes.py +253 -0
- nuitka/code_generation/__init__.py +19 -0
- nuitka/code_generation/c_types/CTypeBases.py +177 -0
- nuitka/code_generation/c_types/CTypeBooleans.py +104 -0
- nuitka/code_generation/c_types/CTypeCFloats.py +57 -0
- nuitka/code_generation/c_types/CTypeCLongs.py +45 -0
- nuitka/code_generation/c_types/CTypeModuleDictVariables.py +109 -0
- nuitka/code_generation/c_types/CTypeNuitkaBooleans.py +150 -0
- nuitka/code_generation/c_types/CTypeNuitkaInts.py +200 -0
- nuitka/code_generation/c_types/CTypeNuitkaVoids.py +107 -0
- nuitka/code_generation/c_types/CTypePyObjectPointers.py +572 -0
- nuitka/code_generation/c_types/CTypeVoids.py +92 -0
- nuitka/code_generation/c_types/__init__.py +19 -0
- nuitka/code_generation/templates/CodeTemplatesAsyncgens.py +106 -0
- nuitka/code_generation/templates/CodeTemplatesConstants.py +296 -0
- nuitka/code_generation/templates/CodeTemplatesCoroutines.py +109 -0
- nuitka/code_generation/templates/CodeTemplatesExceptions.py +84 -0
- nuitka/code_generation/templates/CodeTemplatesFrames.py +235 -0
- nuitka/code_generation/templates/CodeTemplatesFunction.py +117 -0
- nuitka/code_generation/templates/CodeTemplatesGeneratorFunction.py +130 -0
- nuitka/code_generation/templates/CodeTemplatesIterators.py +40 -0
- nuitka/code_generation/templates/CodeTemplatesLoader.py +180 -0
- nuitka/code_generation/templates/CodeTemplatesModules.py +710 -0
- nuitka/code_generation/templates/CodeTemplatesVariables.py +388 -0
- nuitka/code_generation/templates/TemplateDebugWrapper.py +80 -0
- nuitka/code_generation/templates/__init__.py +19 -0
- nuitka/code_generation/templates_c/CodeTemplateCallsMethodPositional.c.j2 +321 -0
- nuitka/code_generation/templates_c/CodeTemplateCallsMixed.c.j2 +143 -0
- nuitka/code_generation/templates_c/CodeTemplateCallsPositional.c.j2 +677 -0
- nuitka/code_generation/templates_c/CodeTemplateCallsPositionalMethodDescr.c.j2 +165 -0
- nuitka/code_generation/templates_c/CodeTemplateMakeListHinted.c.j2 +38 -0
- nuitka/code_generation/templates_c/CodeTemplateMakeListSmall.c.j2 +41 -0
- nuitka/code_generation/templates_c/HelperBuiltinMethodOperation.c.j2 +53 -0
- nuitka/code_generation/templates_c/HelperDictionaryCopy.c.j2 +364 -0
- nuitka/code_generation/templates_c/HelperImportHard.c.j2 +37 -0
- nuitka/code_generation/templates_c/HelperLongTools.c.j2 +53 -0
- nuitka/code_generation/templates_c/HelperObjectTools.c.j2 +20 -0
- nuitka/code_generation/templates_c/HelperOperationBinary.c.j2 +148 -0
- nuitka/code_generation/templates_c/HelperOperationBinaryDual.c.j2 +115 -0
- nuitka/code_generation/templates_c/HelperOperationComparison.c.j2 +352 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonBytes.c.j2 +115 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonDual.c.j2 +86 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonFloat.c.j2 +31 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonInt.c.j2 +32 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonList.c.j2 +112 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonLong.c.j2 +157 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonStr.c.j2 +115 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonTuple.c.j2 +99 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonUnicode.c.j2 +115 -0
- nuitka/code_generation/templates_c/HelperOperationInplace.c.j2 +281 -0
- nuitka/code_generation/templates_c/HelperSlotsBinary.c.j2 +420 -0
- nuitka/code_generation/templates_c/HelperSlotsBytes.c.j2 +51 -0
- nuitka/code_generation/templates_c/HelperSlotsCommon.c.j2 +71 -0
- nuitka/code_generation/templates_c/HelperSlotsFloat.c.j2 +327 -0
- nuitka/code_generation/templates_c/HelperSlotsInt.c.j2 +411 -0
- nuitka/code_generation/templates_c/HelperSlotsList.c.j2 +59 -0
- nuitka/code_generation/templates_c/HelperSlotsLong.c.j2 +229 -0
- nuitka/code_generation/templates_c/HelperSlotsSet.c.j2 +47 -0
- nuitka/code_generation/templates_c/HelperSlotsStr.c.j2 +55 -0
- nuitka/code_generation/templates_c/HelperSlotsTuple.c.j2 +58 -0
- nuitka/code_generation/templates_c/HelperSlotsUnicode.c.j2 +62 -0
- nuitka/containers/Namedtuples.py +51 -0
- nuitka/containers/OrderedDicts.py +191 -0
- nuitka/containers/OrderedSets.py +123 -0
- nuitka/containers/OrderedSetsFallback.py +139 -0
- nuitka/containers/__init__.py +19 -0
- nuitka/distutils/Build.py +76 -0
- nuitka/distutils/DistutilCommands.py +438 -0
- nuitka/distutils/__init__.py +19 -0
- nuitka/finalizations/Finalization.py +35 -0
- nuitka/finalizations/FinalizeMarkups.py +136 -0
- nuitka/finalizations/__init__.py +19 -0
- nuitka/freezer/DependsExe.py +257 -0
- nuitka/freezer/DllDependenciesCommon.py +97 -0
- nuitka/freezer/DllDependenciesMacOS.py +444 -0
- nuitka/freezer/DllDependenciesPosix.py +242 -0
- nuitka/freezer/DllDependenciesWin32.py +315 -0
- nuitka/freezer/ImportDetection.py +359 -0
- nuitka/freezer/IncludedDataFiles.py +689 -0
- nuitka/freezer/IncludedEntryPoints.py +376 -0
- nuitka/freezer/Onefile.py +296 -0
- nuitka/freezer/Standalone.py +520 -0
- nuitka/freezer/__init__.py +19 -0
- nuitka/importing/IgnoreListing.py +449 -0
- nuitka/importing/ImportCache.py +95 -0
- nuitka/importing/ImportResolving.py +186 -0
- nuitka/importing/Importing.py +1200 -0
- nuitka/importing/PreloadedPackages.py +164 -0
- nuitka/importing/Recursion.py +611 -0
- nuitka/importing/StandardLibrary.py +429 -0
- nuitka/importing/__init__.py +19 -0
- nuitka/nodes/AsyncgenNodes.py +107 -0
- nuitka/nodes/AttributeLookupNodes.py +124 -0
- nuitka/nodes/AttributeNodes.py +386 -0
- nuitka/nodes/AttributeNodesGenerated.py +10734 -0
- nuitka/nodes/BuiltinAllNodes.py +115 -0
- nuitka/nodes/BuiltinAnyNodes.py +124 -0
- nuitka/nodes/BuiltinComplexNodes.py +83 -0
- nuitka/nodes/BuiltinDecodingNodes.py +52 -0
- nuitka/nodes/BuiltinDecoratorNodes.py +85 -0
- nuitka/nodes/BuiltinDictNodes.py +140 -0
- nuitka/nodes/BuiltinFormatNodes.py +159 -0
- nuitka/nodes/BuiltinHashNodes.py +63 -0
- nuitka/nodes/BuiltinInputNodes.py +39 -0
- nuitka/nodes/BuiltinIntegerNodes.py +170 -0
- nuitka/nodes/BuiltinIteratorNodes.py +391 -0
- nuitka/nodes/BuiltinLenNodes.py +61 -0
- nuitka/nodes/BuiltinNextNodes.py +111 -0
- nuitka/nodes/BuiltinOpenNodes.py +148 -0
- nuitka/nodes/BuiltinOperationNodeBasesGenerated.py +7367 -0
- nuitka/nodes/BuiltinRangeNodes.py +690 -0
- nuitka/nodes/BuiltinRefNodes.py +314 -0
- nuitka/nodes/BuiltinSumNodes.py +104 -0
- nuitka/nodes/BuiltinTypeNodes.py +454 -0
- nuitka/nodes/BuiltinVarsNodes.py +44 -0
- nuitka/nodes/BytesNodes.py +829 -0
- nuitka/nodes/CallNodes.py +217 -0
- nuitka/nodes/Checkers.py +55 -0
- nuitka/nodes/ChildrenHavingMixins.py +21576 -0
- nuitka/nodes/ClassNodes.py +286 -0
- nuitka/nodes/CodeObjectSpecs.py +230 -0
- nuitka/nodes/ComparisonNodes.py +687 -0
- nuitka/nodes/ConditionalNodes.py +884 -0
- nuitka/nodes/ConstantRefNodes.py +1717 -0
- nuitka/nodes/ContainerMakingNodes.py +408 -0
- nuitka/nodes/ContainerOperationNodes.py +87 -0
- nuitka/nodes/CoroutineNodes.py +144 -0
- nuitka/nodes/CtypesNodes.py +51 -0
- nuitka/nodes/DictionaryNodes.py +1513 -0
- nuitka/nodes/ExceptionNodes.py +393 -0
- nuitka/nodes/ExecEvalNodes.py +229 -0
- nuitka/nodes/ExpressionBases.py +1301 -0
- nuitka/nodes/ExpressionBasesGenerated.py +2103 -0
- nuitka/nodes/ExpressionShapeMixins.py +886 -0
- nuitka/nodes/FrameNodes.py +413 -0
- nuitka/nodes/FunctionAttributeNodes.py +102 -0
- nuitka/nodes/FunctionNodes.py +1303 -0
- nuitka/nodes/FutureSpecs.py +224 -0
- nuitka/nodes/GeneratorNodes.py +201 -0
- nuitka/nodes/GlobalsLocalsNodes.py +209 -0
- nuitka/nodes/HardImportNodesGenerated.py +3599 -0
- nuitka/nodes/ImportHardNodes.py +185 -0
- nuitka/nodes/ImportNodes.py +1366 -0
- nuitka/nodes/IndicatorMixins.py +79 -0
- nuitka/nodes/InjectCNodes.py +51 -0
- nuitka/nodes/IterationHandles.py +407 -0
- nuitka/nodes/KeyValuePairNodes.py +378 -0
- nuitka/nodes/ListOperationNodes.py +525 -0
- nuitka/nodes/LocalsDictNodes.py +717 -0
- nuitka/nodes/LocalsScopes.py +505 -0
- nuitka/nodes/LoopNodes.py +445 -0
- nuitka/nodes/MatchNodes.py +60 -0
- nuitka/nodes/ModuleAttributeNodes.py +180 -0
- nuitka/nodes/ModuleNodes.py +1137 -0
- nuitka/nodes/NetworkxNodes.py +45 -0
- nuitka/nodes/NodeBases.py +890 -0
- nuitka/nodes/NodeMakingHelpers.py +481 -0
- nuitka/nodes/NodeMetaClasses.py +172 -0
- nuitka/nodes/OperatorNodes.py +944 -0
- nuitka/nodes/OperatorNodesUnary.py +403 -0
- nuitka/nodes/OsSysNodes.py +215 -0
- nuitka/nodes/OutlineNodes.py +372 -0
- nuitka/nodes/PackageMetadataNodes.py +982 -0
- nuitka/nodes/PackageResourceNodes.py +424 -0
- nuitka/nodes/PrintNodes.py +105 -0
- nuitka/nodes/ReturnNodes.py +255 -0
- nuitka/nodes/SideEffectNodes.py +139 -0
- nuitka/nodes/SliceNodes.py +386 -0
- nuitka/nodes/StatementBasesGenerated.py +3419 -0
- nuitka/nodes/StatementNodes.py +316 -0
- nuitka/nodes/StrNodes.py +919 -0
- nuitka/nodes/StringConcatenationNodes.py +103 -0
- nuitka/nodes/SubscriptNodes.py +245 -0
- nuitka/nodes/TensorflowNodes.py +38 -0
- nuitka/nodes/TryNodes.py +519 -0
- nuitka/nodes/TypeMatchNodes.py +65 -0
- nuitka/nodes/TypeNodes.py +390 -0
- nuitka/nodes/VariableAssignNodes.py +1177 -0
- nuitka/nodes/VariableDelNodes.py +320 -0
- nuitka/nodes/VariableNameNodes.py +153 -0
- nuitka/nodes/VariableRefNodes.py +895 -0
- nuitka/nodes/VariableReleaseNodes.py +153 -0
- nuitka/nodes/YieldNodes.py +121 -0
- nuitka/nodes/__init__.py +19 -0
- nuitka/nodes/shapes/BuiltinTypeShapes.py +4290 -0
- nuitka/nodes/shapes/ControlFlowDescriptions.py +199 -0
- nuitka/nodes/shapes/IteratorShapes.py +71 -0
- nuitka/nodes/shapes/ShapeMixins.py +255 -0
- nuitka/nodes/shapes/StandardShapes.py +1384 -0
- nuitka/nodes/shapes/__init__.py +19 -0
- nuitka/optimizations/BytecodeDemotion.py +105 -0
- nuitka/optimizations/FunctionInlining.py +110 -0
- nuitka/optimizations/Graphs.py +70 -0
- nuitka/optimizations/Optimization.py +363 -0
- nuitka/optimizations/OptimizeBuiltinCalls.py +1582 -0
- nuitka/optimizations/Tags.py +76 -0
- nuitka/optimizations/TraceCollections.py +1257 -0
- nuitka/optimizations/ValueTraces.py +980 -0
- nuitka/optimizations/__init__.py +19 -0
- nuitka/pgo/PGO.py +160 -0
- nuitka/pgo/__init__.py +19 -0
- nuitka/plugins/PluginBase.py +1924 -0
- nuitka/plugins/Plugins.py +2007 -0
- nuitka/plugins/YamlPluginBase.py +121 -0
- nuitka/plugins/__init__.py +19 -0
- nuitka/plugins/standard/AntiBloatPlugin.py +1024 -0
- nuitka/plugins/standard/ConsiderPyLintAnnotationsPlugin.py +95 -0
- nuitka/plugins/standard/DataFilesPlugin.py +311 -0
- nuitka/plugins/standard/DelvewheelPlugin.py +150 -0
- nuitka/plugins/standard/DillPlugin/DillPlugin.c +37 -0
- nuitka/plugins/standard/DillPlugin/cloudpickle-postLoad.py +67 -0
- nuitka/plugins/standard/DillPlugin/dill-postLoad.py +223 -0
- nuitka/plugins/standard/DillPlugin.py +137 -0
- nuitka/plugins/standard/DllFilesPlugin.py +527 -0
- nuitka/plugins/standard/EnumPlugin.py +64 -0
- nuitka/plugins/standard/EventletPlugin.py +57 -0
- nuitka/plugins/standard/GeventPlugin.py +64 -0
- nuitka/plugins/standard/GiPlugin.py +118 -0
- nuitka/plugins/standard/GlfwPlugin.py +138 -0
- nuitka/plugins/standard/ImplicitImports.py +845 -0
- nuitka/plugins/standard/KivyPlugin.py +141 -0
- nuitka/plugins/standard/MatplotlibPlugin.py +256 -0
- nuitka/plugins/standard/MultiprocessingPlugin.py +199 -0
- nuitka/plugins/standard/NumpyPlugin.py +35 -0
- nuitka/plugins/standard/OptionsNannyPlugin.py +158 -0
- nuitka/plugins/standard/PbrPlugin.py +62 -0
- nuitka/plugins/standard/PkgResourcesPlugin.py +162 -0
- nuitka/plugins/standard/PlaywrightPlugin.py +179 -0
- nuitka/plugins/standard/PmwPlugin.py +248 -0
- nuitka/plugins/standard/PySidePyQtPlugin.py +1666 -0
- nuitka/plugins/standard/PywebViewPlugin.py +81 -0
- nuitka/plugins/standard/SpacyPlugin.py +137 -0
- nuitka/plugins/standard/TensorflowPlugin.py +35 -0
- nuitka/plugins/standard/TkinterPlugin.py +416 -0
- nuitka/plugins/standard/TorchPlugin.py +35 -0
- nuitka/plugins/standard/TransformersPlugin.py +121 -0
- nuitka/plugins/standard/TrioPlugin.py +33 -0
- nuitka/plugins/standard/UpxPlugin.py +174 -0
- nuitka/plugins/standard/__init__.py +19 -0
- nuitka/plugins/standard/standard.nuitka-package.config.yml +9313 -0
- nuitka/plugins/standard/stdlib2.nuitka-package.config.yml +78 -0
- nuitka/plugins/standard/stdlib3.nuitka-package.config.yml +468 -0
- nuitka/reports/CompilationReportReader.py +83 -0
- nuitka/reports/LicenseReport.rst.j2 +41 -0
- nuitka/reports/Reports.py +961 -0
- nuitka/reports/__init__.py +19 -0
- nuitka/specs/BuiltinBytesOperationSpecs.py +180 -0
- nuitka/specs/BuiltinDictOperationSpecs.py +82 -0
- nuitka/specs/BuiltinListOperationSpecs.py +80 -0
- nuitka/specs/BuiltinParameterSpecs.py +831 -0
- nuitka/specs/BuiltinStrOperationSpecs.py +181 -0
- nuitka/specs/BuiltinTypeOperationSpecs.py +34 -0
- nuitka/specs/BuiltinUnicodeOperationSpecs.py +123 -0
- nuitka/specs/HardImportSpecs.py +236 -0
- nuitka/specs/ParameterSpecs.py +630 -0
- nuitka/specs/__init__.py +19 -0
- nuitka/tools/Basics.py +55 -0
- nuitka/tools/__init__.py +19 -0
- nuitka/tools/commercial/__init__.py +21 -0
- nuitka/tools/data_composer/DataComposer.py +593 -0
- nuitka/tools/data_composer/__init__.py +19 -0
- nuitka/tools/data_composer/__main__.py +41 -0
- nuitka/tools/environments/CreateEnvironment.py +69 -0
- nuitka/tools/environments/Virtualenv.py +158 -0
- nuitka/tools/environments/__init__.py +19 -0
- nuitka/tools/general/__init__.py +19 -0
- nuitka/tools/general/dll_report/__init__.py +19 -0
- nuitka/tools/general/dll_report/__main__.py +83 -0
- nuitka/tools/general/find_module/FindModuleCode.py +127 -0
- nuitka/tools/general/find_module/__init__.py +19 -0
- nuitka/tools/general/generate_header/GenerateHeader.py +73 -0
- nuitka/tools/general/generate_header/__init__.py +19 -0
- nuitka/tools/onefile_compressor/OnefileCompressor.py +390 -0
- nuitka/tools/onefile_compressor/__init__.py +19 -0
- nuitka/tools/onefile_compressor/__main__.py +41 -0
- nuitka/tools/podman/Podman.py +55 -0
- nuitka/tools/podman/__init__.py +19 -0
- nuitka/tools/podman/__main__.py +425 -0
- nuitka/tools/profiler/__init__.py +19 -0
- nuitka/tools/profiler/__main__.py +93 -0
- nuitka/tools/scanning/DisplayDistributions.py +39 -0
- nuitka/tools/scanning/DisplayPackageDLLs.py +151 -0
- nuitka/tools/scanning/DisplayPackageData.py +73 -0
- nuitka/tools/scanning/__init__.py +19 -0
- nuitka/tools/specialize/CTypeDescriptions.py +1928 -0
- nuitka/tools/specialize/Common.py +380 -0
- nuitka/tools/specialize/SpecializeC.py +1483 -0
- nuitka/tools/specialize/SpecializePython.py +1151 -0
- nuitka/tools/specialize/__init__.py +19 -0
- nuitka/tools/testing/Common.py +2007 -0
- nuitka/tools/testing/Constructs.py +53 -0
- nuitka/tools/testing/DocTests.py +156 -0
- nuitka/tools/testing/OutputComparison.py +313 -0
- nuitka/tools/testing/Pythons.py +34 -0
- nuitka/tools/testing/RuntimeTracing.py +260 -0
- nuitka/tools/testing/SearchModes.py +208 -0
- nuitka/tools/testing/Valgrind.py +103 -0
- nuitka/tools/testing/__init__.py +19 -0
- nuitka/tools/testing/check_reference_counts/__init__.py +19 -0
- nuitka/tools/testing/check_reference_counts/__main__.py +107 -0
- nuitka/tools/testing/compare_with_cpython/__init__.py +19 -0
- nuitka/tools/testing/compare_with_cpython/__main__.py +942 -0
- nuitka/tools/testing/find_sxs_modules/__init__.py +19 -0
- nuitka/tools/testing/find_sxs_modules/__main__.py +73 -0
- nuitka/tools/testing/measure_construct_performance/__init__.py +19 -0
- nuitka/tools/testing/measure_construct_performance/__main__.py +288 -0
- nuitka/tools/testing/run_nuitka_tests/__init__.py +19 -0
- nuitka/tools/testing/run_nuitka_tests/__main__.py +1091 -0
- nuitka/tools/watch/AutoStage.py +145 -0
- nuitka/tools/watch/Common.py +55 -0
- nuitka/tools/watch/Conda.py +125 -0
- nuitka/tools/watch/GitHub.py +113 -0
- nuitka/tools/watch/Pacman.py +73 -0
- nuitka/tools/watch/Pipenv.py +145 -0
- nuitka/tools/watch/__init__.py +19 -0
- nuitka/tools/watch/__main__.py +615 -0
- nuitka/tree/Building.py +1459 -0
- nuitka/tree/ComplexCallHelperFunctions.py +2150 -0
- nuitka/tree/Extractions.py +48 -0
- nuitka/tree/FutureSpecState.py +71 -0
- nuitka/tree/InternalModule.py +96 -0
- nuitka/tree/Operations.py +45 -0
- nuitka/tree/ReformulationAssertStatements.py +97 -0
- nuitka/tree/ReformulationAssignmentStatements.py +1260 -0
- nuitka/tree/ReformulationBooleanExpressions.py +97 -0
- nuitka/tree/ReformulationCallExpressions.py +314 -0
- nuitka/tree/ReformulationClasses.py +407 -0
- nuitka/tree/ReformulationClasses3.py +1149 -0
- nuitka/tree/ReformulationComparisonExpressions.py +174 -0
- nuitka/tree/ReformulationContractionExpressions.py +676 -0
- nuitka/tree/ReformulationDictionaryCreation.py +304 -0
- nuitka/tree/ReformulationExecStatements.py +386 -0
- nuitka/tree/ReformulationForLoopStatements.py +215 -0
- nuitka/tree/ReformulationFunctionStatements.py +931 -0
- nuitka/tree/ReformulationImportStatements.py +333 -0
- nuitka/tree/ReformulationLambdaExpressions.py +185 -0
- nuitka/tree/ReformulationMatchStatements.py +797 -0
- nuitka/tree/ReformulationMultidist.py +80 -0
- nuitka/tree/ReformulationNamespacePackages.py +239 -0
- nuitka/tree/ReformulationPrintStatements.py +127 -0
- nuitka/tree/ReformulationSequenceCreation.py +438 -0
- nuitka/tree/ReformulationSubscriptExpressions.py +123 -0
- nuitka/tree/ReformulationTryExceptStatements.py +418 -0
- nuitka/tree/ReformulationTryFinallyStatements.py +239 -0
- nuitka/tree/ReformulationWhileLoopStatements.py +160 -0
- nuitka/tree/ReformulationWithStatements.py +382 -0
- nuitka/tree/ReformulationYieldExpressions.py +133 -0
- nuitka/tree/SourceHandling.py +476 -0
- nuitka/tree/SyntaxErrors.py +143 -0
- nuitka/tree/TreeHelpers.py +720 -0
- nuitka/tree/VariableClosure.py +483 -0
- nuitka/tree/__init__.py +19 -0
- nuitka/utils/AppDirs.py +104 -0
- nuitka/utils/CStrings.py +208 -0
- nuitka/utils/CommandLineOptions.py +207 -0
- nuitka/utils/Distributions.py +728 -0
- nuitka/utils/Download.py +217 -0
- nuitka/utils/Execution.py +517 -0
- nuitka/utils/FileOperations.py +1587 -0
- nuitka/utils/Hashing.py +137 -0
- nuitka/utils/Images.py +79 -0
- nuitka/utils/Importing.py +335 -0
- nuitka/utils/InlineCopies.py +52 -0
- nuitka/utils/InstalledPythons.py +254 -0
- nuitka/utils/InstanceCounters.py +86 -0
- nuitka/utils/Jinja2.py +158 -0
- nuitka/utils/Json.py +40 -0
- nuitka/utils/MacOSApp.py +134 -0
- nuitka/utils/MemoryUsage.py +165 -0
- nuitka/utils/ModuleNames.py +317 -0
- nuitka/utils/PackageResources.py +44 -0
- nuitka/utils/ReExecute.py +152 -0
- nuitka/utils/Rest.py +60 -0
- nuitka/utils/SharedLibraries.py +1014 -0
- nuitka/utils/Shebang.py +113 -0
- nuitka/utils/Signing.py +144 -0
- nuitka/utils/SlotMetaClasses.py +57 -0
- nuitka/utils/StaticLibraries.py +260 -0
- nuitka/utils/ThreadedExecutor.py +87 -0
- nuitka/utils/Timing.py +102 -0
- nuitka/utils/Utils.py +483 -0
- nuitka/utils/WindowsFileUsage.py +337 -0
- nuitka/utils/WindowsResources.py +652 -0
- nuitka/utils/Yaml.py +247 -0
- nuitka/utils/__init__.py +19 -0
- nuitka_winsvc-2.7.7.data/scripts/nuitka-run.cmd +24 -0
- nuitka_winsvc-2.7.7.data/scripts/nuitka.cmd +30 -0
- nuitka_winsvc-2.7.7.dist-info/METADATA +115 -0
- nuitka_winsvc-2.7.7.dist-info/RECORD +995 -0
- nuitka_winsvc-2.7.7.dist-info/WHEEL +5 -0
- nuitka_winsvc-2.7.7.dist-info/entry_points.txt +7 -0
- nuitka_winsvc-2.7.7.dist-info/licenses/LICENSE.txt +202 -0
- nuitka_winsvc-2.7.7.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,3599 @@
|
|
|
1
|
+
# Copyright 2025, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
# We are not avoiding these in generated code at all
|
|
5
|
+
# pylint: disable=I0021,line-too-long,too-many-instance-attributes,too-many-lines
|
|
6
|
+
# pylint: disable=I0021,too-many-arguments,too-many-return-statements,too-many-statements
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
"""Hard import nodes
|
|
10
|
+
|
|
11
|
+
WARNING, this code is GENERATED. Modify the template HardImportReferenceNode.py.j2 instead!
|
|
12
|
+
|
|
13
|
+
spell-checker: ignore __prepare__ append args autograph capitalize casefold center chars
|
|
14
|
+
spell-checker: ignore clear copy count decode default delete dist distribution_name encode
|
|
15
|
+
spell-checker: ignore encoding end endswith errors exit_code expandtabs
|
|
16
|
+
spell-checker: ignore experimental_attributes experimental_autograph_options
|
|
17
|
+
spell-checker: ignore experimental_compile experimental_follow_type_hints
|
|
18
|
+
spell-checker: ignore experimental_implements experimental_relax_shapes extend fillchar
|
|
19
|
+
spell-checker: ignore find format format_map formatmap fromkeys func get group handle
|
|
20
|
+
spell-checker: ignore has_key haskey index input_signature insert isalnum isalpha isascii
|
|
21
|
+
spell-checker: ignore isdecimal isdigit isidentifier islower isnumeric isprintable isspace
|
|
22
|
+
spell-checker: ignore istitle isupper item items iterable iteritems iterkeys itervalues
|
|
23
|
+
spell-checker: ignore jit_compile join keepends key keys kwargs ljust lower lstrip
|
|
24
|
+
spell-checker: ignore maketrans maxsplit mode name new old p package
|
|
25
|
+
spell-checker: ignore package_or_requirement pairs partition path pop popitem prefix
|
|
26
|
+
spell-checker: ignore prepare reduce_retracing remove replace resource resource_name
|
|
27
|
+
spell-checker: ignore reverse rfind rindex rjust rpartition rsplit rstrip s sep setdefault
|
|
28
|
+
spell-checker: ignore sort split splitlines start startswith stop strip sub suffix
|
|
29
|
+
spell-checker: ignore swapcase table tabsize title translate update upper use_errno
|
|
30
|
+
spell-checker: ignore use_last_error value values viewitems viewkeys viewvalues width
|
|
31
|
+
spell-checker: ignore winmode zfill
|
|
32
|
+
"""
|
|
33
|
+
import os
|
|
34
|
+
from abc import abstractmethod
|
|
35
|
+
|
|
36
|
+
from nuitka.Options import shallMakeModule
|
|
37
|
+
from nuitka.PythonVersions import python_version
|
|
38
|
+
from nuitka.specs.BuiltinParameterSpecs import extractBuiltinArgs
|
|
39
|
+
from nuitka.specs.HardImportSpecs import (
|
|
40
|
+
ctypes_cdll_before_38_spec,
|
|
41
|
+
ctypes_cdll_since_38_spec,
|
|
42
|
+
importlib_metadata_backport_distribution_spec,
|
|
43
|
+
importlib_metadata_backport_entry_points_spec,
|
|
44
|
+
importlib_metadata_backport_metadata_spec,
|
|
45
|
+
importlib_metadata_backport_version_spec,
|
|
46
|
+
importlib_metadata_distribution_spec,
|
|
47
|
+
importlib_metadata_entry_points_before_310_spec,
|
|
48
|
+
importlib_metadata_entry_points_since_310_spec,
|
|
49
|
+
importlib_metadata_metadata_spec,
|
|
50
|
+
importlib_metadata_version_spec,
|
|
51
|
+
importlib_resources_backport_files_spec,
|
|
52
|
+
importlib_resources_backport_read_binary_spec,
|
|
53
|
+
importlib_resources_backport_read_text_spec,
|
|
54
|
+
importlib_resources_files_spec,
|
|
55
|
+
importlib_resources_read_binary_spec,
|
|
56
|
+
importlib_resources_read_text_before_313_spec,
|
|
57
|
+
importlib_resources_read_text_since_313_spec,
|
|
58
|
+
os_listdir_spec,
|
|
59
|
+
os_lstat_spec,
|
|
60
|
+
os_path_abspath_spec,
|
|
61
|
+
os_path_basename_spec,
|
|
62
|
+
os_path_dirname_spec,
|
|
63
|
+
os_path_exists_spec,
|
|
64
|
+
os_path_isabs_spec,
|
|
65
|
+
os_path_isdir_spec,
|
|
66
|
+
os_path_isfile_spec,
|
|
67
|
+
os_path_normpath_spec,
|
|
68
|
+
os_stat_spec,
|
|
69
|
+
os_uname_spec,
|
|
70
|
+
pkg_resources_get_distribution_spec,
|
|
71
|
+
pkg_resources_iter_entry_points_spec,
|
|
72
|
+
pkg_resources_require_spec,
|
|
73
|
+
pkg_resources_resource_stream_spec,
|
|
74
|
+
pkg_resources_resource_string_spec,
|
|
75
|
+
pkgutil_get_data_spec,
|
|
76
|
+
sys_exit_spec,
|
|
77
|
+
tensorflow_function_spec,
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
from .ChildrenHavingMixins import (
|
|
81
|
+
ChildHavingDistMixin,
|
|
82
|
+
ChildHavingDistributionNameMixin,
|
|
83
|
+
ChildHavingExitCodeOptionalMixin,
|
|
84
|
+
ChildHavingPackageMixin,
|
|
85
|
+
ChildHavingParamsTupleMixin,
|
|
86
|
+
ChildHavingPathMixin,
|
|
87
|
+
ChildHavingPathOptionalMixin,
|
|
88
|
+
ChildHavingPMixin,
|
|
89
|
+
ChildHavingRequirementsTupleMixin,
|
|
90
|
+
ChildHavingSMixin,
|
|
91
|
+
ChildrenHavingFuncOptionalInputSignatureOptionalAutographOptionalJitCompileOptionalReduceRetracingOptionalExperimentalImplementsOptionalExperimentalAutographOptionsOptionalExperimentalAttributesOptionalExperimentalRelaxShapesOptionalExperimentalCompileOptionalExperimentalFollowTypeHintsOptionalMixin,
|
|
92
|
+
ChildrenHavingGroupNameOptionalMixin,
|
|
93
|
+
ChildrenHavingNameModeOptionalHandleOptionalUseErrnoOptionalUseLastErrorOptionalMixin,
|
|
94
|
+
ChildrenHavingNameModeOptionalHandleOptionalUseErrnoOptionalUseLastErrorOptionalWinmodeOptionalMixin,
|
|
95
|
+
ChildrenHavingPackageOptionalResourcesTupleEncodingOptionalErrorsOptionalMixin,
|
|
96
|
+
ChildrenHavingPackageOrRequirementResourceNameMixin,
|
|
97
|
+
ChildrenHavingPackageResourceEncodingOptionalErrorsOptionalMixin,
|
|
98
|
+
ChildrenHavingPackageResourceMixin,
|
|
99
|
+
ChildrenHavingPathOptionalDirFdOptionalFollowSymlinksOptionalMixin,
|
|
100
|
+
ChildrenHavingPathOptionalDirFdOptionalMixin,
|
|
101
|
+
)
|
|
102
|
+
from .ExpressionBases import ExpressionBase
|
|
103
|
+
from .ExpressionShapeMixins import (
|
|
104
|
+
ExpressionBoolShapeExactMixin,
|
|
105
|
+
ExpressionBytesShapeExactMixin,
|
|
106
|
+
ExpressionDictShapeExactMixin,
|
|
107
|
+
ExpressionStrShapeExactMixin,
|
|
108
|
+
)
|
|
109
|
+
from .ImportHardNodes import ExpressionImportModuleNameHardExistsSpecificBase
|
|
110
|
+
|
|
111
|
+
hard_import_node_classes = {}
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
class ExpressionCtypesCdllRef(ExpressionImportModuleNameHardExistsSpecificBase):
|
|
115
|
+
"""Function reference ctypes.CDLL"""
|
|
116
|
+
|
|
117
|
+
kind = "EXPRESSION_CTYPES_CDLL_REF"
|
|
118
|
+
|
|
119
|
+
def __init__(self, source_ref):
|
|
120
|
+
ExpressionImportModuleNameHardExistsSpecificBase.__init__(
|
|
121
|
+
self,
|
|
122
|
+
module_name="ctypes",
|
|
123
|
+
import_name="CDLL",
|
|
124
|
+
module_guaranteed=True,
|
|
125
|
+
source_ref=source_ref,
|
|
126
|
+
)
|
|
127
|
+
|
|
128
|
+
def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):
|
|
129
|
+
# Anything may happen on call trace before this. On next pass, if
|
|
130
|
+
# replaced, we might be better but not now.
|
|
131
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
132
|
+
|
|
133
|
+
if python_version >= 0x380:
|
|
134
|
+
from .CtypesNodes import ExpressionCtypesCdllSince38Call
|
|
135
|
+
|
|
136
|
+
result = extractBuiltinArgs(
|
|
137
|
+
node=call_node,
|
|
138
|
+
builtin_class=ExpressionCtypesCdllSince38Call,
|
|
139
|
+
builtin_spec=ctypes_cdll_since_38_spec,
|
|
140
|
+
)
|
|
141
|
+
|
|
142
|
+
return (
|
|
143
|
+
result,
|
|
144
|
+
"new_expression",
|
|
145
|
+
"Call to 'ctypes.CDLL' recognized.",
|
|
146
|
+
)
|
|
147
|
+
|
|
148
|
+
if python_version < 0x380:
|
|
149
|
+
from .CtypesNodes import ExpressionCtypesCdllBefore38Call
|
|
150
|
+
|
|
151
|
+
result = extractBuiltinArgs(
|
|
152
|
+
node=call_node,
|
|
153
|
+
builtin_class=ExpressionCtypesCdllBefore38Call,
|
|
154
|
+
builtin_spec=ctypes_cdll_before_38_spec,
|
|
155
|
+
)
|
|
156
|
+
|
|
157
|
+
return (
|
|
158
|
+
result,
|
|
159
|
+
"new_expression",
|
|
160
|
+
"Call to 'ctypes.CDLL' recognized.",
|
|
161
|
+
)
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
hard_import_node_classes[ExpressionCtypesCdllRef] = ctypes_cdll_since_38_spec
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
class ExpressionCtypesCdllSince38CallBase(
|
|
168
|
+
ChildrenHavingNameModeOptionalHandleOptionalUseErrnoOptionalUseLastErrorOptionalWinmodeOptionalMixin,
|
|
169
|
+
ExpressionBase,
|
|
170
|
+
):
|
|
171
|
+
"""Base class for CtypesCdllCall
|
|
172
|
+
|
|
173
|
+
Generated boiler plate code from 'HardImportCallNode.py.j2' template.
|
|
174
|
+
"""
|
|
175
|
+
|
|
176
|
+
python_version_spec = ">= 0x380"
|
|
177
|
+
|
|
178
|
+
named_children = (
|
|
179
|
+
"name",
|
|
180
|
+
"mode|optional",
|
|
181
|
+
"handle|optional",
|
|
182
|
+
"use_errno|optional",
|
|
183
|
+
"use_last_error|optional",
|
|
184
|
+
"winmode|optional",
|
|
185
|
+
)
|
|
186
|
+
|
|
187
|
+
__slots__ = ("attempted",)
|
|
188
|
+
|
|
189
|
+
spec = ctypes_cdll_since_38_spec
|
|
190
|
+
|
|
191
|
+
def __init__(
|
|
192
|
+
self, name, mode, handle, use_errno, use_last_error, winmode, source_ref
|
|
193
|
+
):
|
|
194
|
+
|
|
195
|
+
ChildrenHavingNameModeOptionalHandleOptionalUseErrnoOptionalUseLastErrorOptionalWinmodeOptionalMixin.__init__(
|
|
196
|
+
self,
|
|
197
|
+
name=name,
|
|
198
|
+
mode=mode,
|
|
199
|
+
handle=handle,
|
|
200
|
+
use_errno=use_errno,
|
|
201
|
+
use_last_error=use_last_error,
|
|
202
|
+
winmode=winmode,
|
|
203
|
+
)
|
|
204
|
+
|
|
205
|
+
ExpressionBase.__init__(self, source_ref)
|
|
206
|
+
|
|
207
|
+
self.attempted = False
|
|
208
|
+
|
|
209
|
+
def computeExpression(self, trace_collection):
|
|
210
|
+
if self.attempted or not ctypes_cdll_since_38_spec.isCompileTimeComputable(
|
|
211
|
+
(
|
|
212
|
+
self.subnode_name,
|
|
213
|
+
self.subnode_mode,
|
|
214
|
+
self.subnode_handle,
|
|
215
|
+
self.subnode_use_errno,
|
|
216
|
+
self.subnode_use_last_error,
|
|
217
|
+
self.subnode_winmode,
|
|
218
|
+
)
|
|
219
|
+
):
|
|
220
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
221
|
+
|
|
222
|
+
return self, None, None
|
|
223
|
+
|
|
224
|
+
try:
|
|
225
|
+
return self.replaceWithCompileTimeValue(trace_collection)
|
|
226
|
+
finally:
|
|
227
|
+
self.attempted = True
|
|
228
|
+
|
|
229
|
+
@abstractmethod
|
|
230
|
+
def replaceWithCompileTimeValue(self, trace_collection):
|
|
231
|
+
pass
|
|
232
|
+
|
|
233
|
+
@staticmethod
|
|
234
|
+
def mayRaiseExceptionOperation():
|
|
235
|
+
return True
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
class ExpressionCtypesCdllBefore38CallBase(
|
|
239
|
+
ChildrenHavingNameModeOptionalHandleOptionalUseErrnoOptionalUseLastErrorOptionalMixin,
|
|
240
|
+
ExpressionBase,
|
|
241
|
+
):
|
|
242
|
+
"""Base class for CtypesCdllCall
|
|
243
|
+
|
|
244
|
+
Generated boiler plate code from 'HardImportCallNode.py.j2' template.
|
|
245
|
+
"""
|
|
246
|
+
|
|
247
|
+
python_version_spec = "< 0x380"
|
|
248
|
+
|
|
249
|
+
named_children = (
|
|
250
|
+
"name",
|
|
251
|
+
"mode|optional",
|
|
252
|
+
"handle|optional",
|
|
253
|
+
"use_errno|optional",
|
|
254
|
+
"use_last_error|optional",
|
|
255
|
+
)
|
|
256
|
+
|
|
257
|
+
__slots__ = ("attempted",)
|
|
258
|
+
|
|
259
|
+
spec = ctypes_cdll_before_38_spec
|
|
260
|
+
|
|
261
|
+
def __init__(self, name, mode, handle, use_errno, use_last_error, source_ref):
|
|
262
|
+
|
|
263
|
+
ChildrenHavingNameModeOptionalHandleOptionalUseErrnoOptionalUseLastErrorOptionalMixin.__init__(
|
|
264
|
+
self,
|
|
265
|
+
name=name,
|
|
266
|
+
mode=mode,
|
|
267
|
+
handle=handle,
|
|
268
|
+
use_errno=use_errno,
|
|
269
|
+
use_last_error=use_last_error,
|
|
270
|
+
)
|
|
271
|
+
|
|
272
|
+
ExpressionBase.__init__(self, source_ref)
|
|
273
|
+
|
|
274
|
+
self.attempted = False
|
|
275
|
+
|
|
276
|
+
def computeExpression(self, trace_collection):
|
|
277
|
+
if self.attempted or not ctypes_cdll_before_38_spec.isCompileTimeComputable(
|
|
278
|
+
(
|
|
279
|
+
self.subnode_name,
|
|
280
|
+
self.subnode_mode,
|
|
281
|
+
self.subnode_handle,
|
|
282
|
+
self.subnode_use_errno,
|
|
283
|
+
self.subnode_use_last_error,
|
|
284
|
+
)
|
|
285
|
+
):
|
|
286
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
287
|
+
|
|
288
|
+
return self, None, None
|
|
289
|
+
|
|
290
|
+
try:
|
|
291
|
+
return self.replaceWithCompileTimeValue(trace_collection)
|
|
292
|
+
finally:
|
|
293
|
+
self.attempted = True
|
|
294
|
+
|
|
295
|
+
@abstractmethod
|
|
296
|
+
def replaceWithCompileTimeValue(self, trace_collection):
|
|
297
|
+
pass
|
|
298
|
+
|
|
299
|
+
@staticmethod
|
|
300
|
+
def mayRaiseExceptionOperation():
|
|
301
|
+
return True
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
class ExpressionImportlibMetadataBackportDistributionRef(
|
|
305
|
+
ExpressionImportModuleNameHardExistsSpecificBase
|
|
306
|
+
):
|
|
307
|
+
"""Function reference importlib_metadata.distribution"""
|
|
308
|
+
|
|
309
|
+
kind = "EXPRESSION_IMPORTLIB_METADATA_BACKPORT_DISTRIBUTION_REF"
|
|
310
|
+
|
|
311
|
+
def __init__(self, source_ref):
|
|
312
|
+
ExpressionImportModuleNameHardExistsSpecificBase.__init__(
|
|
313
|
+
self,
|
|
314
|
+
module_name="importlib_metadata",
|
|
315
|
+
import_name="distribution",
|
|
316
|
+
module_guaranteed=not shallMakeModule(),
|
|
317
|
+
source_ref=source_ref,
|
|
318
|
+
)
|
|
319
|
+
|
|
320
|
+
def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):
|
|
321
|
+
# Anything may happen on call trace before this. On next pass, if
|
|
322
|
+
# replaced, we might be better but not now.
|
|
323
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
324
|
+
|
|
325
|
+
from .PackageMetadataNodes import (
|
|
326
|
+
ExpressionImportlibMetadataBackportDistributionCall,
|
|
327
|
+
)
|
|
328
|
+
|
|
329
|
+
result = extractBuiltinArgs(
|
|
330
|
+
node=call_node,
|
|
331
|
+
builtin_class=ExpressionImportlibMetadataBackportDistributionCall,
|
|
332
|
+
builtin_spec=importlib_metadata_backport_distribution_spec,
|
|
333
|
+
)
|
|
334
|
+
|
|
335
|
+
return (
|
|
336
|
+
result,
|
|
337
|
+
"new_expression",
|
|
338
|
+
"Call to 'importlib_metadata.distribution' recognized.",
|
|
339
|
+
)
|
|
340
|
+
|
|
341
|
+
|
|
342
|
+
hard_import_node_classes[ExpressionImportlibMetadataBackportDistributionRef] = (
|
|
343
|
+
importlib_metadata_backport_distribution_spec
|
|
344
|
+
)
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+
class ExpressionImportlibMetadataBackportDistributionCallBase(
|
|
348
|
+
ChildHavingDistributionNameMixin, ExpressionBase
|
|
349
|
+
):
|
|
350
|
+
"""Base class for ImportlibMetadataBackportDistributionCall
|
|
351
|
+
|
|
352
|
+
Generated boiler plate code from 'HardImportCallNode.py.j2' template.
|
|
353
|
+
"""
|
|
354
|
+
|
|
355
|
+
named_children = ("distribution_name",)
|
|
356
|
+
|
|
357
|
+
__slots__ = ("attempted",)
|
|
358
|
+
|
|
359
|
+
spec = importlib_metadata_backport_distribution_spec
|
|
360
|
+
|
|
361
|
+
def __init__(self, distribution_name, source_ref):
|
|
362
|
+
|
|
363
|
+
ChildHavingDistributionNameMixin.__init__(
|
|
364
|
+
self,
|
|
365
|
+
distribution_name=distribution_name,
|
|
366
|
+
)
|
|
367
|
+
|
|
368
|
+
ExpressionBase.__init__(self, source_ref)
|
|
369
|
+
|
|
370
|
+
# In module mode, we expect a changing environment, cannot optimize this
|
|
371
|
+
self.attempted = shallMakeModule()
|
|
372
|
+
|
|
373
|
+
def computeExpression(self, trace_collection):
|
|
374
|
+
if (
|
|
375
|
+
self.attempted
|
|
376
|
+
or not importlib_metadata_backport_distribution_spec.isCompileTimeComputable(
|
|
377
|
+
(self.subnode_distribution_name,)
|
|
378
|
+
)
|
|
379
|
+
):
|
|
380
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
381
|
+
|
|
382
|
+
return self, None, None
|
|
383
|
+
|
|
384
|
+
try:
|
|
385
|
+
return self.replaceWithCompileTimeValue(trace_collection)
|
|
386
|
+
finally:
|
|
387
|
+
self.attempted = True
|
|
388
|
+
|
|
389
|
+
@abstractmethod
|
|
390
|
+
def replaceWithCompileTimeValue(self, trace_collection):
|
|
391
|
+
pass
|
|
392
|
+
|
|
393
|
+
@staticmethod
|
|
394
|
+
def mayRaiseExceptionOperation():
|
|
395
|
+
return True
|
|
396
|
+
|
|
397
|
+
|
|
398
|
+
class ExpressionImportlibMetadataBackportEntryPointsRef(
|
|
399
|
+
ExpressionImportModuleNameHardExistsSpecificBase
|
|
400
|
+
):
|
|
401
|
+
"""Function reference importlib_metadata.entry_points"""
|
|
402
|
+
|
|
403
|
+
kind = "EXPRESSION_IMPORTLIB_METADATA_BACKPORT_ENTRY_POINTS_REF"
|
|
404
|
+
|
|
405
|
+
def __init__(self, source_ref):
|
|
406
|
+
ExpressionImportModuleNameHardExistsSpecificBase.__init__(
|
|
407
|
+
self,
|
|
408
|
+
module_name="importlib_metadata",
|
|
409
|
+
import_name="entry_points",
|
|
410
|
+
module_guaranteed=not shallMakeModule(),
|
|
411
|
+
source_ref=source_ref,
|
|
412
|
+
)
|
|
413
|
+
|
|
414
|
+
def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):
|
|
415
|
+
# Anything may happen on call trace before this. On next pass, if
|
|
416
|
+
# replaced, we might be better but not now.
|
|
417
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
418
|
+
|
|
419
|
+
from .PackageMetadataNodes import (
|
|
420
|
+
makeExpressionImportlibMetadataBackportEntryPointsCall,
|
|
421
|
+
)
|
|
422
|
+
|
|
423
|
+
result = extractBuiltinArgs(
|
|
424
|
+
node=call_node,
|
|
425
|
+
builtin_class=makeExpressionImportlibMetadataBackportEntryPointsCall,
|
|
426
|
+
builtin_spec=importlib_metadata_backport_entry_points_spec,
|
|
427
|
+
)
|
|
428
|
+
|
|
429
|
+
return (
|
|
430
|
+
result,
|
|
431
|
+
"new_expression",
|
|
432
|
+
"Call to 'importlib_metadata.entry_points' recognized.",
|
|
433
|
+
)
|
|
434
|
+
|
|
435
|
+
|
|
436
|
+
hard_import_node_classes[ExpressionImportlibMetadataBackportEntryPointsRef] = (
|
|
437
|
+
importlib_metadata_backport_entry_points_spec
|
|
438
|
+
)
|
|
439
|
+
|
|
440
|
+
|
|
441
|
+
class ExpressionImportlibMetadataBackportEntryPointsCallBase(
|
|
442
|
+
ChildHavingParamsTupleMixin, ExpressionBase
|
|
443
|
+
):
|
|
444
|
+
"""Base class for ImportlibMetadataBackportEntryPointsCall
|
|
445
|
+
|
|
446
|
+
Generated boiler plate code from 'HardImportCallNode.py.j2' template.
|
|
447
|
+
"""
|
|
448
|
+
|
|
449
|
+
named_children = ("params|tuple",)
|
|
450
|
+
|
|
451
|
+
__slots__ = ("attempted",)
|
|
452
|
+
|
|
453
|
+
spec = importlib_metadata_backport_entry_points_spec
|
|
454
|
+
|
|
455
|
+
def __init__(self, params, source_ref):
|
|
456
|
+
|
|
457
|
+
ChildHavingParamsTupleMixin.__init__(
|
|
458
|
+
self,
|
|
459
|
+
params=params,
|
|
460
|
+
)
|
|
461
|
+
|
|
462
|
+
ExpressionBase.__init__(self, source_ref)
|
|
463
|
+
|
|
464
|
+
# In module mode, we expect a changing environment, cannot optimize this
|
|
465
|
+
self.attempted = shallMakeModule()
|
|
466
|
+
|
|
467
|
+
def computeExpression(self, trace_collection):
|
|
468
|
+
if (
|
|
469
|
+
self.attempted
|
|
470
|
+
or not importlib_metadata_backport_entry_points_spec.isCompileTimeComputable(
|
|
471
|
+
() + self.subnode_params
|
|
472
|
+
)
|
|
473
|
+
):
|
|
474
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
475
|
+
|
|
476
|
+
return self, None, None
|
|
477
|
+
|
|
478
|
+
try:
|
|
479
|
+
return self.replaceWithCompileTimeValue(trace_collection)
|
|
480
|
+
finally:
|
|
481
|
+
self.attempted = True
|
|
482
|
+
|
|
483
|
+
@abstractmethod
|
|
484
|
+
def replaceWithCompileTimeValue(self, trace_collection):
|
|
485
|
+
pass
|
|
486
|
+
|
|
487
|
+
@staticmethod
|
|
488
|
+
def mayRaiseExceptionOperation():
|
|
489
|
+
return True
|
|
490
|
+
|
|
491
|
+
|
|
492
|
+
class ExpressionImportlibMetadataBackportMetadataRef(
|
|
493
|
+
ExpressionImportModuleNameHardExistsSpecificBase
|
|
494
|
+
):
|
|
495
|
+
"""Function reference importlib_metadata.metadata"""
|
|
496
|
+
|
|
497
|
+
kind = "EXPRESSION_IMPORTLIB_METADATA_BACKPORT_METADATA_REF"
|
|
498
|
+
|
|
499
|
+
def __init__(self, source_ref):
|
|
500
|
+
ExpressionImportModuleNameHardExistsSpecificBase.__init__(
|
|
501
|
+
self,
|
|
502
|
+
module_name="importlib_metadata",
|
|
503
|
+
import_name="metadata",
|
|
504
|
+
module_guaranteed=not shallMakeModule(),
|
|
505
|
+
source_ref=source_ref,
|
|
506
|
+
)
|
|
507
|
+
|
|
508
|
+
def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):
|
|
509
|
+
# Anything may happen on call trace before this. On next pass, if
|
|
510
|
+
# replaced, we might be better but not now.
|
|
511
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
512
|
+
|
|
513
|
+
from .PackageMetadataNodes import (
|
|
514
|
+
makeExpressionImportlibMetadataBackportMetadataCall,
|
|
515
|
+
)
|
|
516
|
+
|
|
517
|
+
result = extractBuiltinArgs(
|
|
518
|
+
node=call_node,
|
|
519
|
+
builtin_class=makeExpressionImportlibMetadataBackportMetadataCall,
|
|
520
|
+
builtin_spec=importlib_metadata_backport_metadata_spec,
|
|
521
|
+
)
|
|
522
|
+
|
|
523
|
+
return (
|
|
524
|
+
result,
|
|
525
|
+
"new_expression",
|
|
526
|
+
"Call to 'importlib_metadata.metadata' recognized.",
|
|
527
|
+
)
|
|
528
|
+
|
|
529
|
+
|
|
530
|
+
hard_import_node_classes[ExpressionImportlibMetadataBackportMetadataRef] = (
|
|
531
|
+
importlib_metadata_backport_metadata_spec
|
|
532
|
+
)
|
|
533
|
+
|
|
534
|
+
|
|
535
|
+
class ExpressionImportlibMetadataBackportMetadataCallBase(
|
|
536
|
+
ChildHavingDistributionNameMixin, ExpressionBase
|
|
537
|
+
):
|
|
538
|
+
"""Base class for ImportlibMetadataBackportMetadataCall
|
|
539
|
+
|
|
540
|
+
Generated boiler plate code from 'HardImportCallNode.py.j2' template.
|
|
541
|
+
"""
|
|
542
|
+
|
|
543
|
+
named_children = ("distribution_name",)
|
|
544
|
+
|
|
545
|
+
__slots__ = ("attempted",)
|
|
546
|
+
|
|
547
|
+
spec = importlib_metadata_backport_metadata_spec
|
|
548
|
+
|
|
549
|
+
def __init__(self, distribution_name, source_ref):
|
|
550
|
+
|
|
551
|
+
ChildHavingDistributionNameMixin.__init__(
|
|
552
|
+
self,
|
|
553
|
+
distribution_name=distribution_name,
|
|
554
|
+
)
|
|
555
|
+
|
|
556
|
+
ExpressionBase.__init__(self, source_ref)
|
|
557
|
+
|
|
558
|
+
# In module mode, we expect a changing environment, cannot optimize this
|
|
559
|
+
self.attempted = shallMakeModule()
|
|
560
|
+
|
|
561
|
+
def computeExpression(self, trace_collection):
|
|
562
|
+
if (
|
|
563
|
+
self.attempted
|
|
564
|
+
or not importlib_metadata_backport_metadata_spec.isCompileTimeComputable(
|
|
565
|
+
(self.subnode_distribution_name,)
|
|
566
|
+
)
|
|
567
|
+
):
|
|
568
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
569
|
+
|
|
570
|
+
return self, None, None
|
|
571
|
+
|
|
572
|
+
try:
|
|
573
|
+
return self.replaceWithCompileTimeValue(trace_collection)
|
|
574
|
+
finally:
|
|
575
|
+
self.attempted = True
|
|
576
|
+
|
|
577
|
+
@abstractmethod
|
|
578
|
+
def replaceWithCompileTimeValue(self, trace_collection):
|
|
579
|
+
pass
|
|
580
|
+
|
|
581
|
+
@staticmethod
|
|
582
|
+
def mayRaiseExceptionOperation():
|
|
583
|
+
return True
|
|
584
|
+
|
|
585
|
+
|
|
586
|
+
class ExpressionImportlibMetadataBackportVersionRef(
|
|
587
|
+
ExpressionImportModuleNameHardExistsSpecificBase
|
|
588
|
+
):
|
|
589
|
+
"""Function reference importlib_metadata.version"""
|
|
590
|
+
|
|
591
|
+
kind = "EXPRESSION_IMPORTLIB_METADATA_BACKPORT_VERSION_REF"
|
|
592
|
+
|
|
593
|
+
def __init__(self, source_ref):
|
|
594
|
+
ExpressionImportModuleNameHardExistsSpecificBase.__init__(
|
|
595
|
+
self,
|
|
596
|
+
module_name="importlib_metadata",
|
|
597
|
+
import_name="version",
|
|
598
|
+
module_guaranteed=not shallMakeModule(),
|
|
599
|
+
source_ref=source_ref,
|
|
600
|
+
)
|
|
601
|
+
|
|
602
|
+
def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):
|
|
603
|
+
# Anything may happen on call trace before this. On next pass, if
|
|
604
|
+
# replaced, we might be better but not now.
|
|
605
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
606
|
+
|
|
607
|
+
from .PackageMetadataNodes import (
|
|
608
|
+
ExpressionImportlibMetadataBackportVersionCall,
|
|
609
|
+
)
|
|
610
|
+
|
|
611
|
+
result = extractBuiltinArgs(
|
|
612
|
+
node=call_node,
|
|
613
|
+
builtin_class=ExpressionImportlibMetadataBackportVersionCall,
|
|
614
|
+
builtin_spec=importlib_metadata_backport_version_spec,
|
|
615
|
+
)
|
|
616
|
+
|
|
617
|
+
return (
|
|
618
|
+
result,
|
|
619
|
+
"new_expression",
|
|
620
|
+
"Call to 'importlib_metadata.version' recognized.",
|
|
621
|
+
)
|
|
622
|
+
|
|
623
|
+
|
|
624
|
+
hard_import_node_classes[ExpressionImportlibMetadataBackportVersionRef] = (
|
|
625
|
+
importlib_metadata_backport_version_spec
|
|
626
|
+
)
|
|
627
|
+
|
|
628
|
+
|
|
629
|
+
class ExpressionImportlibMetadataBackportVersionCallBase(
|
|
630
|
+
ChildHavingDistributionNameMixin, ExpressionBase
|
|
631
|
+
):
|
|
632
|
+
"""Base class for ImportlibMetadataBackportVersionCall
|
|
633
|
+
|
|
634
|
+
Generated boiler plate code from 'HardImportCallNode.py.j2' template.
|
|
635
|
+
"""
|
|
636
|
+
|
|
637
|
+
named_children = ("distribution_name",)
|
|
638
|
+
|
|
639
|
+
__slots__ = ("attempted",)
|
|
640
|
+
|
|
641
|
+
spec = importlib_metadata_backport_version_spec
|
|
642
|
+
|
|
643
|
+
def __init__(self, distribution_name, source_ref):
|
|
644
|
+
|
|
645
|
+
ChildHavingDistributionNameMixin.__init__(
|
|
646
|
+
self,
|
|
647
|
+
distribution_name=distribution_name,
|
|
648
|
+
)
|
|
649
|
+
|
|
650
|
+
ExpressionBase.__init__(self, source_ref)
|
|
651
|
+
|
|
652
|
+
# In module mode, we expect a changing environment, cannot optimize this
|
|
653
|
+
self.attempted = shallMakeModule()
|
|
654
|
+
|
|
655
|
+
def computeExpression(self, trace_collection):
|
|
656
|
+
if (
|
|
657
|
+
self.attempted
|
|
658
|
+
or not importlib_metadata_backport_version_spec.isCompileTimeComputable(
|
|
659
|
+
(self.subnode_distribution_name,)
|
|
660
|
+
)
|
|
661
|
+
):
|
|
662
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
663
|
+
|
|
664
|
+
return self, None, None
|
|
665
|
+
|
|
666
|
+
try:
|
|
667
|
+
return self.replaceWithCompileTimeValue(trace_collection)
|
|
668
|
+
finally:
|
|
669
|
+
self.attempted = True
|
|
670
|
+
|
|
671
|
+
@abstractmethod
|
|
672
|
+
def replaceWithCompileTimeValue(self, trace_collection):
|
|
673
|
+
pass
|
|
674
|
+
|
|
675
|
+
@staticmethod
|
|
676
|
+
def mayRaiseExceptionOperation():
|
|
677
|
+
return True
|
|
678
|
+
|
|
679
|
+
|
|
680
|
+
class ExpressionImportlibMetadataDistributionRef(
|
|
681
|
+
ExpressionImportModuleNameHardExistsSpecificBase
|
|
682
|
+
):
|
|
683
|
+
"""Function reference importlib.metadata.distribution"""
|
|
684
|
+
|
|
685
|
+
kind = "EXPRESSION_IMPORTLIB_METADATA_DISTRIBUTION_REF"
|
|
686
|
+
|
|
687
|
+
def __init__(self, source_ref):
|
|
688
|
+
ExpressionImportModuleNameHardExistsSpecificBase.__init__(
|
|
689
|
+
self,
|
|
690
|
+
module_name="importlib.metadata",
|
|
691
|
+
import_name="distribution",
|
|
692
|
+
module_guaranteed=True,
|
|
693
|
+
source_ref=source_ref,
|
|
694
|
+
)
|
|
695
|
+
|
|
696
|
+
def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):
|
|
697
|
+
# Anything may happen on call trace before this. On next pass, if
|
|
698
|
+
# replaced, we might be better but not now.
|
|
699
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
700
|
+
|
|
701
|
+
from .PackageMetadataNodes import (
|
|
702
|
+
ExpressionImportlibMetadataDistributionCall,
|
|
703
|
+
)
|
|
704
|
+
|
|
705
|
+
result = extractBuiltinArgs(
|
|
706
|
+
node=call_node,
|
|
707
|
+
builtin_class=ExpressionImportlibMetadataDistributionCall,
|
|
708
|
+
builtin_spec=importlib_metadata_distribution_spec,
|
|
709
|
+
)
|
|
710
|
+
|
|
711
|
+
return (
|
|
712
|
+
result,
|
|
713
|
+
"new_expression",
|
|
714
|
+
"Call to 'importlib.metadata.distribution' recognized.",
|
|
715
|
+
)
|
|
716
|
+
|
|
717
|
+
|
|
718
|
+
hard_import_node_classes[ExpressionImportlibMetadataDistributionRef] = (
|
|
719
|
+
importlib_metadata_distribution_spec
|
|
720
|
+
)
|
|
721
|
+
|
|
722
|
+
|
|
723
|
+
class ExpressionImportlibMetadataDistributionCallBase(
|
|
724
|
+
ChildHavingDistributionNameMixin, ExpressionBase
|
|
725
|
+
):
|
|
726
|
+
"""Base class for ImportlibMetadataDistributionCall
|
|
727
|
+
|
|
728
|
+
Generated boiler plate code from 'HardImportCallNode.py.j2' template.
|
|
729
|
+
"""
|
|
730
|
+
|
|
731
|
+
named_children = ("distribution_name",)
|
|
732
|
+
|
|
733
|
+
__slots__ = ("attempted",)
|
|
734
|
+
|
|
735
|
+
spec = importlib_metadata_distribution_spec
|
|
736
|
+
|
|
737
|
+
def __init__(self, distribution_name, source_ref):
|
|
738
|
+
|
|
739
|
+
ChildHavingDistributionNameMixin.__init__(
|
|
740
|
+
self,
|
|
741
|
+
distribution_name=distribution_name,
|
|
742
|
+
)
|
|
743
|
+
|
|
744
|
+
ExpressionBase.__init__(self, source_ref)
|
|
745
|
+
|
|
746
|
+
self.attempted = False
|
|
747
|
+
|
|
748
|
+
def computeExpression(self, trace_collection):
|
|
749
|
+
if (
|
|
750
|
+
self.attempted
|
|
751
|
+
or not importlib_metadata_distribution_spec.isCompileTimeComputable(
|
|
752
|
+
(self.subnode_distribution_name,)
|
|
753
|
+
)
|
|
754
|
+
):
|
|
755
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
756
|
+
|
|
757
|
+
return self, None, None
|
|
758
|
+
|
|
759
|
+
try:
|
|
760
|
+
return self.replaceWithCompileTimeValue(trace_collection)
|
|
761
|
+
finally:
|
|
762
|
+
self.attempted = True
|
|
763
|
+
|
|
764
|
+
@abstractmethod
|
|
765
|
+
def replaceWithCompileTimeValue(self, trace_collection):
|
|
766
|
+
pass
|
|
767
|
+
|
|
768
|
+
@staticmethod
|
|
769
|
+
def mayRaiseExceptionOperation():
|
|
770
|
+
return True
|
|
771
|
+
|
|
772
|
+
|
|
773
|
+
class ExpressionImportlibMetadataEntryPointsRef(
|
|
774
|
+
ExpressionImportModuleNameHardExistsSpecificBase
|
|
775
|
+
):
|
|
776
|
+
"""Function reference importlib.metadata.entry_points"""
|
|
777
|
+
|
|
778
|
+
kind = "EXPRESSION_IMPORTLIB_METADATA_ENTRY_POINTS_REF"
|
|
779
|
+
|
|
780
|
+
def __init__(self, source_ref):
|
|
781
|
+
ExpressionImportModuleNameHardExistsSpecificBase.__init__(
|
|
782
|
+
self,
|
|
783
|
+
module_name="importlib.metadata",
|
|
784
|
+
import_name="entry_points",
|
|
785
|
+
module_guaranteed=True,
|
|
786
|
+
source_ref=source_ref,
|
|
787
|
+
)
|
|
788
|
+
|
|
789
|
+
def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):
|
|
790
|
+
# Anything may happen on call trace before this. On next pass, if
|
|
791
|
+
# replaced, we might be better but not now.
|
|
792
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
793
|
+
|
|
794
|
+
if python_version >= 0x3A0:
|
|
795
|
+
from .PackageMetadataNodes import (
|
|
796
|
+
makeExpressionImportlibMetadataEntryPointsSince310Call,
|
|
797
|
+
)
|
|
798
|
+
|
|
799
|
+
result = extractBuiltinArgs(
|
|
800
|
+
node=call_node,
|
|
801
|
+
builtin_class=makeExpressionImportlibMetadataEntryPointsSince310Call,
|
|
802
|
+
builtin_spec=importlib_metadata_entry_points_since_310_spec,
|
|
803
|
+
)
|
|
804
|
+
|
|
805
|
+
return (
|
|
806
|
+
result,
|
|
807
|
+
"new_expression",
|
|
808
|
+
"Call to 'importlib.metadata.entry_points' recognized.",
|
|
809
|
+
)
|
|
810
|
+
|
|
811
|
+
if python_version < 0x3A0:
|
|
812
|
+
from .PackageMetadataNodes import (
|
|
813
|
+
ExpressionImportlibMetadataEntryPointsBefore310Call,
|
|
814
|
+
)
|
|
815
|
+
|
|
816
|
+
result = extractBuiltinArgs(
|
|
817
|
+
node=call_node,
|
|
818
|
+
builtin_class=ExpressionImportlibMetadataEntryPointsBefore310Call,
|
|
819
|
+
builtin_spec=importlib_metadata_entry_points_before_310_spec,
|
|
820
|
+
)
|
|
821
|
+
|
|
822
|
+
return (
|
|
823
|
+
result,
|
|
824
|
+
"new_expression",
|
|
825
|
+
"Call to 'importlib.metadata.entry_points' recognized.",
|
|
826
|
+
)
|
|
827
|
+
|
|
828
|
+
|
|
829
|
+
hard_import_node_classes[ExpressionImportlibMetadataEntryPointsRef] = (
|
|
830
|
+
importlib_metadata_entry_points_since_310_spec
|
|
831
|
+
)
|
|
832
|
+
|
|
833
|
+
|
|
834
|
+
class ExpressionImportlibMetadataEntryPointsSince310CallBase(
|
|
835
|
+
ChildHavingParamsTupleMixin, ExpressionBase
|
|
836
|
+
):
|
|
837
|
+
"""Base class for ImportlibMetadataEntryPointsCall
|
|
838
|
+
|
|
839
|
+
Generated boiler plate code from 'HardImportCallNode.py.j2' template.
|
|
840
|
+
"""
|
|
841
|
+
|
|
842
|
+
python_version_spec = ">= 0x3a0"
|
|
843
|
+
|
|
844
|
+
named_children = ("params|tuple",)
|
|
845
|
+
|
|
846
|
+
__slots__ = ("attempted",)
|
|
847
|
+
|
|
848
|
+
spec = importlib_metadata_entry_points_since_310_spec
|
|
849
|
+
|
|
850
|
+
def __init__(self, params, source_ref):
|
|
851
|
+
|
|
852
|
+
ChildHavingParamsTupleMixin.__init__(
|
|
853
|
+
self,
|
|
854
|
+
params=params,
|
|
855
|
+
)
|
|
856
|
+
|
|
857
|
+
ExpressionBase.__init__(self, source_ref)
|
|
858
|
+
|
|
859
|
+
self.attempted = False
|
|
860
|
+
|
|
861
|
+
def computeExpression(self, trace_collection):
|
|
862
|
+
if (
|
|
863
|
+
self.attempted
|
|
864
|
+
or not importlib_metadata_entry_points_since_310_spec.isCompileTimeComputable(
|
|
865
|
+
() + self.subnode_params
|
|
866
|
+
)
|
|
867
|
+
):
|
|
868
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
869
|
+
|
|
870
|
+
return self, None, None
|
|
871
|
+
|
|
872
|
+
try:
|
|
873
|
+
return self.replaceWithCompileTimeValue(trace_collection)
|
|
874
|
+
finally:
|
|
875
|
+
self.attempted = True
|
|
876
|
+
|
|
877
|
+
@abstractmethod
|
|
878
|
+
def replaceWithCompileTimeValue(self, trace_collection):
|
|
879
|
+
pass
|
|
880
|
+
|
|
881
|
+
@staticmethod
|
|
882
|
+
def mayRaiseExceptionOperation():
|
|
883
|
+
return True
|
|
884
|
+
|
|
885
|
+
|
|
886
|
+
class ExpressionImportlibMetadataEntryPointsBefore310CallBase(
|
|
887
|
+
ExpressionDictShapeExactMixin, ExpressionBase
|
|
888
|
+
):
|
|
889
|
+
"""Base class for ImportlibMetadataEntryPointsCall
|
|
890
|
+
|
|
891
|
+
Generated boiler plate code from 'HardImportCallNode.py.j2' template.
|
|
892
|
+
"""
|
|
893
|
+
|
|
894
|
+
python_version_spec = "< 0x3a0"
|
|
895
|
+
|
|
896
|
+
__slots__ = ("attempted",)
|
|
897
|
+
|
|
898
|
+
spec = importlib_metadata_entry_points_before_310_spec
|
|
899
|
+
|
|
900
|
+
def __init__(self, source_ref):
|
|
901
|
+
|
|
902
|
+
ExpressionBase.__init__(self, source_ref)
|
|
903
|
+
|
|
904
|
+
self.attempted = False
|
|
905
|
+
|
|
906
|
+
def finalize(self):
|
|
907
|
+
del self.parent
|
|
908
|
+
|
|
909
|
+
def computeExpressionRaw(self, trace_collection):
|
|
910
|
+
if self.attempted:
|
|
911
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
912
|
+
|
|
913
|
+
return self, None, None
|
|
914
|
+
|
|
915
|
+
try:
|
|
916
|
+
return self.replaceWithCompileTimeValue(trace_collection)
|
|
917
|
+
finally:
|
|
918
|
+
self.attempted = True
|
|
919
|
+
|
|
920
|
+
@abstractmethod
|
|
921
|
+
def replaceWithCompileTimeValue(self, trace_collection):
|
|
922
|
+
pass
|
|
923
|
+
|
|
924
|
+
@staticmethod
|
|
925
|
+
def mayRaiseExceptionOperation():
|
|
926
|
+
return True
|
|
927
|
+
|
|
928
|
+
|
|
929
|
+
class ExpressionImportlibMetadataMetadataRef(
|
|
930
|
+
ExpressionImportModuleNameHardExistsSpecificBase
|
|
931
|
+
):
|
|
932
|
+
"""Function reference importlib.metadata.metadata"""
|
|
933
|
+
|
|
934
|
+
kind = "EXPRESSION_IMPORTLIB_METADATA_METADATA_REF"
|
|
935
|
+
|
|
936
|
+
def __init__(self, source_ref):
|
|
937
|
+
ExpressionImportModuleNameHardExistsSpecificBase.__init__(
|
|
938
|
+
self,
|
|
939
|
+
module_name="importlib.metadata",
|
|
940
|
+
import_name="metadata",
|
|
941
|
+
module_guaranteed=True,
|
|
942
|
+
source_ref=source_ref,
|
|
943
|
+
)
|
|
944
|
+
|
|
945
|
+
def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):
|
|
946
|
+
# Anything may happen on call trace before this. On next pass, if
|
|
947
|
+
# replaced, we might be better but not now.
|
|
948
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
949
|
+
|
|
950
|
+
from .PackageMetadataNodes import (
|
|
951
|
+
makeExpressionImportlibMetadataMetadataCall,
|
|
952
|
+
)
|
|
953
|
+
|
|
954
|
+
result = extractBuiltinArgs(
|
|
955
|
+
node=call_node,
|
|
956
|
+
builtin_class=makeExpressionImportlibMetadataMetadataCall,
|
|
957
|
+
builtin_spec=importlib_metadata_metadata_spec,
|
|
958
|
+
)
|
|
959
|
+
|
|
960
|
+
return (
|
|
961
|
+
result,
|
|
962
|
+
"new_expression",
|
|
963
|
+
"Call to 'importlib.metadata.metadata' recognized.",
|
|
964
|
+
)
|
|
965
|
+
|
|
966
|
+
|
|
967
|
+
hard_import_node_classes[ExpressionImportlibMetadataMetadataRef] = (
|
|
968
|
+
importlib_metadata_metadata_spec
|
|
969
|
+
)
|
|
970
|
+
|
|
971
|
+
|
|
972
|
+
class ExpressionImportlibMetadataMetadataCallBase(
|
|
973
|
+
ChildHavingDistributionNameMixin, ExpressionBase
|
|
974
|
+
):
|
|
975
|
+
"""Base class for ImportlibMetadataMetadataCall
|
|
976
|
+
|
|
977
|
+
Generated boiler plate code from 'HardImportCallNode.py.j2' template.
|
|
978
|
+
"""
|
|
979
|
+
|
|
980
|
+
named_children = ("distribution_name",)
|
|
981
|
+
|
|
982
|
+
__slots__ = ("attempted",)
|
|
983
|
+
|
|
984
|
+
spec = importlib_metadata_metadata_spec
|
|
985
|
+
|
|
986
|
+
def __init__(self, distribution_name, source_ref):
|
|
987
|
+
|
|
988
|
+
ChildHavingDistributionNameMixin.__init__(
|
|
989
|
+
self,
|
|
990
|
+
distribution_name=distribution_name,
|
|
991
|
+
)
|
|
992
|
+
|
|
993
|
+
ExpressionBase.__init__(self, source_ref)
|
|
994
|
+
|
|
995
|
+
self.attempted = False
|
|
996
|
+
|
|
997
|
+
def computeExpression(self, trace_collection):
|
|
998
|
+
if (
|
|
999
|
+
self.attempted
|
|
1000
|
+
or not importlib_metadata_metadata_spec.isCompileTimeComputable(
|
|
1001
|
+
(self.subnode_distribution_name,)
|
|
1002
|
+
)
|
|
1003
|
+
):
|
|
1004
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
1005
|
+
|
|
1006
|
+
return self, None, None
|
|
1007
|
+
|
|
1008
|
+
try:
|
|
1009
|
+
return self.replaceWithCompileTimeValue(trace_collection)
|
|
1010
|
+
finally:
|
|
1011
|
+
self.attempted = True
|
|
1012
|
+
|
|
1013
|
+
@abstractmethod
|
|
1014
|
+
def replaceWithCompileTimeValue(self, trace_collection):
|
|
1015
|
+
pass
|
|
1016
|
+
|
|
1017
|
+
@staticmethod
|
|
1018
|
+
def mayRaiseExceptionOperation():
|
|
1019
|
+
return True
|
|
1020
|
+
|
|
1021
|
+
|
|
1022
|
+
class ExpressionImportlibMetadataVersionRef(
|
|
1023
|
+
ExpressionImportModuleNameHardExistsSpecificBase
|
|
1024
|
+
):
|
|
1025
|
+
"""Function reference importlib.metadata.version"""
|
|
1026
|
+
|
|
1027
|
+
kind = "EXPRESSION_IMPORTLIB_METADATA_VERSION_REF"
|
|
1028
|
+
|
|
1029
|
+
def __init__(self, source_ref):
|
|
1030
|
+
ExpressionImportModuleNameHardExistsSpecificBase.__init__(
|
|
1031
|
+
self,
|
|
1032
|
+
module_name="importlib.metadata",
|
|
1033
|
+
import_name="version",
|
|
1034
|
+
module_guaranteed=True,
|
|
1035
|
+
source_ref=source_ref,
|
|
1036
|
+
)
|
|
1037
|
+
|
|
1038
|
+
def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):
|
|
1039
|
+
# Anything may happen on call trace before this. On next pass, if
|
|
1040
|
+
# replaced, we might be better but not now.
|
|
1041
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
1042
|
+
|
|
1043
|
+
from .PackageMetadataNodes import (
|
|
1044
|
+
ExpressionImportlibMetadataVersionCall,
|
|
1045
|
+
)
|
|
1046
|
+
|
|
1047
|
+
result = extractBuiltinArgs(
|
|
1048
|
+
node=call_node,
|
|
1049
|
+
builtin_class=ExpressionImportlibMetadataVersionCall,
|
|
1050
|
+
builtin_spec=importlib_metadata_version_spec,
|
|
1051
|
+
)
|
|
1052
|
+
|
|
1053
|
+
return (
|
|
1054
|
+
result,
|
|
1055
|
+
"new_expression",
|
|
1056
|
+
"Call to 'importlib.metadata.version' recognized.",
|
|
1057
|
+
)
|
|
1058
|
+
|
|
1059
|
+
|
|
1060
|
+
hard_import_node_classes[ExpressionImportlibMetadataVersionRef] = (
|
|
1061
|
+
importlib_metadata_version_spec
|
|
1062
|
+
)
|
|
1063
|
+
|
|
1064
|
+
|
|
1065
|
+
class ExpressionImportlibMetadataVersionCallBase(
|
|
1066
|
+
ChildHavingDistributionNameMixin, ExpressionBase
|
|
1067
|
+
):
|
|
1068
|
+
"""Base class for ImportlibMetadataVersionCall
|
|
1069
|
+
|
|
1070
|
+
Generated boiler plate code from 'HardImportCallNode.py.j2' template.
|
|
1071
|
+
"""
|
|
1072
|
+
|
|
1073
|
+
named_children = ("distribution_name",)
|
|
1074
|
+
|
|
1075
|
+
__slots__ = ("attempted",)
|
|
1076
|
+
|
|
1077
|
+
spec = importlib_metadata_version_spec
|
|
1078
|
+
|
|
1079
|
+
def __init__(self, distribution_name, source_ref):
|
|
1080
|
+
|
|
1081
|
+
ChildHavingDistributionNameMixin.__init__(
|
|
1082
|
+
self,
|
|
1083
|
+
distribution_name=distribution_name,
|
|
1084
|
+
)
|
|
1085
|
+
|
|
1086
|
+
ExpressionBase.__init__(self, source_ref)
|
|
1087
|
+
|
|
1088
|
+
self.attempted = False
|
|
1089
|
+
|
|
1090
|
+
def computeExpression(self, trace_collection):
|
|
1091
|
+
if (
|
|
1092
|
+
self.attempted
|
|
1093
|
+
or not importlib_metadata_version_spec.isCompileTimeComputable(
|
|
1094
|
+
(self.subnode_distribution_name,)
|
|
1095
|
+
)
|
|
1096
|
+
):
|
|
1097
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
1098
|
+
|
|
1099
|
+
return self, None, None
|
|
1100
|
+
|
|
1101
|
+
try:
|
|
1102
|
+
return self.replaceWithCompileTimeValue(trace_collection)
|
|
1103
|
+
finally:
|
|
1104
|
+
self.attempted = True
|
|
1105
|
+
|
|
1106
|
+
@abstractmethod
|
|
1107
|
+
def replaceWithCompileTimeValue(self, trace_collection):
|
|
1108
|
+
pass
|
|
1109
|
+
|
|
1110
|
+
@staticmethod
|
|
1111
|
+
def mayRaiseExceptionOperation():
|
|
1112
|
+
return True
|
|
1113
|
+
|
|
1114
|
+
|
|
1115
|
+
class ExpressionImportlibResourcesBackportFilesRef(
|
|
1116
|
+
ExpressionImportModuleNameHardExistsSpecificBase
|
|
1117
|
+
):
|
|
1118
|
+
"""Function reference importlib_resources.files"""
|
|
1119
|
+
|
|
1120
|
+
kind = "EXPRESSION_IMPORTLIB_RESOURCES_BACKPORT_FILES_REF"
|
|
1121
|
+
|
|
1122
|
+
def __init__(self, source_ref):
|
|
1123
|
+
ExpressionImportModuleNameHardExistsSpecificBase.__init__(
|
|
1124
|
+
self,
|
|
1125
|
+
module_name="importlib_resources",
|
|
1126
|
+
import_name="files",
|
|
1127
|
+
module_guaranteed=not shallMakeModule(),
|
|
1128
|
+
source_ref=source_ref,
|
|
1129
|
+
)
|
|
1130
|
+
|
|
1131
|
+
def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):
|
|
1132
|
+
# Anything may happen on call trace before this. On next pass, if
|
|
1133
|
+
# replaced, we might be better but not now.
|
|
1134
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
1135
|
+
|
|
1136
|
+
from .PackageResourceNodes import (
|
|
1137
|
+
ExpressionImportlibResourcesBackportFilesCall,
|
|
1138
|
+
)
|
|
1139
|
+
|
|
1140
|
+
result = extractBuiltinArgs(
|
|
1141
|
+
node=call_node,
|
|
1142
|
+
builtin_class=ExpressionImportlibResourcesBackportFilesCall,
|
|
1143
|
+
builtin_spec=importlib_resources_backport_files_spec,
|
|
1144
|
+
)
|
|
1145
|
+
|
|
1146
|
+
return (
|
|
1147
|
+
result,
|
|
1148
|
+
"new_expression",
|
|
1149
|
+
"Call to 'importlib_resources.files' recognized.",
|
|
1150
|
+
)
|
|
1151
|
+
|
|
1152
|
+
|
|
1153
|
+
hard_import_node_classes[ExpressionImportlibResourcesBackportFilesRef] = (
|
|
1154
|
+
importlib_resources_backport_files_spec
|
|
1155
|
+
)
|
|
1156
|
+
|
|
1157
|
+
|
|
1158
|
+
class ExpressionImportlibResourcesBackportFilesCallBase(
|
|
1159
|
+
ChildHavingPackageMixin, ExpressionBase
|
|
1160
|
+
):
|
|
1161
|
+
"""Base class for ImportlibResourcesBackportFilesCall
|
|
1162
|
+
|
|
1163
|
+
Generated boiler plate code from 'HardImportCallNode.py.j2' template.
|
|
1164
|
+
"""
|
|
1165
|
+
|
|
1166
|
+
named_children = ("package",)
|
|
1167
|
+
|
|
1168
|
+
__slots__ = ("attempted",)
|
|
1169
|
+
|
|
1170
|
+
spec = importlib_resources_backport_files_spec
|
|
1171
|
+
|
|
1172
|
+
def __init__(self, package, source_ref):
|
|
1173
|
+
|
|
1174
|
+
ChildHavingPackageMixin.__init__(
|
|
1175
|
+
self,
|
|
1176
|
+
package=package,
|
|
1177
|
+
)
|
|
1178
|
+
|
|
1179
|
+
ExpressionBase.__init__(self, source_ref)
|
|
1180
|
+
|
|
1181
|
+
# In module mode, we expect a changing environment, cannot optimize this
|
|
1182
|
+
self.attempted = shallMakeModule()
|
|
1183
|
+
|
|
1184
|
+
def computeExpression(self, trace_collection):
|
|
1185
|
+
if (
|
|
1186
|
+
self.attempted
|
|
1187
|
+
or not importlib_resources_backport_files_spec.isCompileTimeComputable(
|
|
1188
|
+
(self.subnode_package,)
|
|
1189
|
+
)
|
|
1190
|
+
):
|
|
1191
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
1192
|
+
|
|
1193
|
+
return self, None, None
|
|
1194
|
+
|
|
1195
|
+
try:
|
|
1196
|
+
return self.replaceWithCompileTimeValue(trace_collection)
|
|
1197
|
+
finally:
|
|
1198
|
+
self.attempted = True
|
|
1199
|
+
|
|
1200
|
+
@abstractmethod
|
|
1201
|
+
def replaceWithCompileTimeValue(self, trace_collection):
|
|
1202
|
+
pass
|
|
1203
|
+
|
|
1204
|
+
@staticmethod
|
|
1205
|
+
def mayRaiseExceptionOperation():
|
|
1206
|
+
return True
|
|
1207
|
+
|
|
1208
|
+
|
|
1209
|
+
class ExpressionImportlibResourcesBackportReadBinaryRef(
|
|
1210
|
+
ExpressionImportModuleNameHardExistsSpecificBase
|
|
1211
|
+
):
|
|
1212
|
+
"""Function reference importlib_resources.read_binary"""
|
|
1213
|
+
|
|
1214
|
+
kind = "EXPRESSION_IMPORTLIB_RESOURCES_BACKPORT_READ_BINARY_REF"
|
|
1215
|
+
|
|
1216
|
+
def __init__(self, source_ref):
|
|
1217
|
+
ExpressionImportModuleNameHardExistsSpecificBase.__init__(
|
|
1218
|
+
self,
|
|
1219
|
+
module_name="importlib_resources",
|
|
1220
|
+
import_name="read_binary",
|
|
1221
|
+
module_guaranteed=not shallMakeModule(),
|
|
1222
|
+
source_ref=source_ref,
|
|
1223
|
+
)
|
|
1224
|
+
|
|
1225
|
+
def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):
|
|
1226
|
+
# Anything may happen on call trace before this. On next pass, if
|
|
1227
|
+
# replaced, we might be better but not now.
|
|
1228
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
1229
|
+
|
|
1230
|
+
from .PackageResourceNodes import (
|
|
1231
|
+
ExpressionImportlibResourcesBackportReadBinaryCall,
|
|
1232
|
+
)
|
|
1233
|
+
|
|
1234
|
+
result = extractBuiltinArgs(
|
|
1235
|
+
node=call_node,
|
|
1236
|
+
builtin_class=ExpressionImportlibResourcesBackportReadBinaryCall,
|
|
1237
|
+
builtin_spec=importlib_resources_backport_read_binary_spec,
|
|
1238
|
+
)
|
|
1239
|
+
|
|
1240
|
+
return (
|
|
1241
|
+
result,
|
|
1242
|
+
"new_expression",
|
|
1243
|
+
"Call to 'importlib_resources.read_binary' recognized.",
|
|
1244
|
+
)
|
|
1245
|
+
|
|
1246
|
+
|
|
1247
|
+
hard_import_node_classes[ExpressionImportlibResourcesBackportReadBinaryRef] = (
|
|
1248
|
+
importlib_resources_backport_read_binary_spec
|
|
1249
|
+
)
|
|
1250
|
+
|
|
1251
|
+
|
|
1252
|
+
class ExpressionImportlibResourcesBackportReadBinaryCallBase(
|
|
1253
|
+
ExpressionBytesShapeExactMixin, ChildrenHavingPackageResourceMixin, ExpressionBase
|
|
1254
|
+
):
|
|
1255
|
+
"""Base class for ImportlibResourcesBackportReadBinaryCall
|
|
1256
|
+
|
|
1257
|
+
Generated boiler plate code from 'HardImportCallNode.py.j2' template.
|
|
1258
|
+
"""
|
|
1259
|
+
|
|
1260
|
+
named_children = (
|
|
1261
|
+
"package",
|
|
1262
|
+
"resource",
|
|
1263
|
+
)
|
|
1264
|
+
|
|
1265
|
+
__slots__ = ("attempted",)
|
|
1266
|
+
|
|
1267
|
+
spec = importlib_resources_backport_read_binary_spec
|
|
1268
|
+
|
|
1269
|
+
def __init__(self, package, resource, source_ref):
|
|
1270
|
+
|
|
1271
|
+
ChildrenHavingPackageResourceMixin.__init__(
|
|
1272
|
+
self,
|
|
1273
|
+
package=package,
|
|
1274
|
+
resource=resource,
|
|
1275
|
+
)
|
|
1276
|
+
|
|
1277
|
+
ExpressionBase.__init__(self, source_ref)
|
|
1278
|
+
|
|
1279
|
+
# In module mode, we expect a changing environment, cannot optimize this
|
|
1280
|
+
self.attempted = shallMakeModule()
|
|
1281
|
+
|
|
1282
|
+
def computeExpression(self, trace_collection):
|
|
1283
|
+
if (
|
|
1284
|
+
self.attempted
|
|
1285
|
+
or not importlib_resources_backport_read_binary_spec.isCompileTimeComputable(
|
|
1286
|
+
(
|
|
1287
|
+
self.subnode_package,
|
|
1288
|
+
self.subnode_resource,
|
|
1289
|
+
)
|
|
1290
|
+
)
|
|
1291
|
+
):
|
|
1292
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
1293
|
+
|
|
1294
|
+
return self, None, None
|
|
1295
|
+
|
|
1296
|
+
try:
|
|
1297
|
+
return self.replaceWithCompileTimeValue(trace_collection)
|
|
1298
|
+
finally:
|
|
1299
|
+
self.attempted = True
|
|
1300
|
+
|
|
1301
|
+
@abstractmethod
|
|
1302
|
+
def replaceWithCompileTimeValue(self, trace_collection):
|
|
1303
|
+
pass
|
|
1304
|
+
|
|
1305
|
+
@staticmethod
|
|
1306
|
+
def mayRaiseExceptionOperation():
|
|
1307
|
+
return True
|
|
1308
|
+
|
|
1309
|
+
|
|
1310
|
+
class ExpressionImportlibResourcesBackportReadTextRef(
|
|
1311
|
+
ExpressionImportModuleNameHardExistsSpecificBase
|
|
1312
|
+
):
|
|
1313
|
+
"""Function reference importlib_resources.read_text"""
|
|
1314
|
+
|
|
1315
|
+
kind = "EXPRESSION_IMPORTLIB_RESOURCES_BACKPORT_READ_TEXT_REF"
|
|
1316
|
+
|
|
1317
|
+
def __init__(self, source_ref):
|
|
1318
|
+
ExpressionImportModuleNameHardExistsSpecificBase.__init__(
|
|
1319
|
+
self,
|
|
1320
|
+
module_name="importlib_resources",
|
|
1321
|
+
import_name="read_text",
|
|
1322
|
+
module_guaranteed=not shallMakeModule(),
|
|
1323
|
+
source_ref=source_ref,
|
|
1324
|
+
)
|
|
1325
|
+
|
|
1326
|
+
def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):
|
|
1327
|
+
# Anything may happen on call trace before this. On next pass, if
|
|
1328
|
+
# replaced, we might be better but not now.
|
|
1329
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
1330
|
+
|
|
1331
|
+
from .PackageResourceNodes import (
|
|
1332
|
+
makeExpressionImportlibResourcesBackportReadTextCall,
|
|
1333
|
+
)
|
|
1334
|
+
|
|
1335
|
+
result = extractBuiltinArgs(
|
|
1336
|
+
node=call_node,
|
|
1337
|
+
builtin_class=makeExpressionImportlibResourcesBackportReadTextCall,
|
|
1338
|
+
builtin_spec=importlib_resources_backport_read_text_spec,
|
|
1339
|
+
)
|
|
1340
|
+
|
|
1341
|
+
return (
|
|
1342
|
+
result,
|
|
1343
|
+
"new_expression",
|
|
1344
|
+
"Call to 'importlib_resources.read_text' recognized.",
|
|
1345
|
+
)
|
|
1346
|
+
|
|
1347
|
+
|
|
1348
|
+
hard_import_node_classes[ExpressionImportlibResourcesBackportReadTextRef] = (
|
|
1349
|
+
importlib_resources_backport_read_text_spec
|
|
1350
|
+
)
|
|
1351
|
+
|
|
1352
|
+
|
|
1353
|
+
class ExpressionImportlibResourcesBackportReadTextCallBase(
|
|
1354
|
+
ExpressionStrShapeExactMixin,
|
|
1355
|
+
ChildrenHavingPackageResourceEncodingOptionalErrorsOptionalMixin,
|
|
1356
|
+
ExpressionBase,
|
|
1357
|
+
):
|
|
1358
|
+
"""Base class for ImportlibResourcesBackportReadTextCall
|
|
1359
|
+
|
|
1360
|
+
Generated boiler plate code from 'HardImportCallNode.py.j2' template.
|
|
1361
|
+
"""
|
|
1362
|
+
|
|
1363
|
+
named_children = (
|
|
1364
|
+
"package",
|
|
1365
|
+
"resource",
|
|
1366
|
+
"encoding|optional",
|
|
1367
|
+
"errors|optional",
|
|
1368
|
+
)
|
|
1369
|
+
|
|
1370
|
+
__slots__ = ("attempted",)
|
|
1371
|
+
|
|
1372
|
+
spec = importlib_resources_backport_read_text_spec
|
|
1373
|
+
|
|
1374
|
+
def __init__(self, package, resource, encoding, errors, source_ref):
|
|
1375
|
+
|
|
1376
|
+
ChildrenHavingPackageResourceEncodingOptionalErrorsOptionalMixin.__init__(
|
|
1377
|
+
self,
|
|
1378
|
+
package=package,
|
|
1379
|
+
resource=resource,
|
|
1380
|
+
encoding=encoding,
|
|
1381
|
+
errors=errors,
|
|
1382
|
+
)
|
|
1383
|
+
|
|
1384
|
+
ExpressionBase.__init__(self, source_ref)
|
|
1385
|
+
|
|
1386
|
+
# In module mode, we expect a changing environment, cannot optimize this
|
|
1387
|
+
self.attempted = shallMakeModule()
|
|
1388
|
+
|
|
1389
|
+
def computeExpression(self, trace_collection):
|
|
1390
|
+
if (
|
|
1391
|
+
self.attempted
|
|
1392
|
+
or not importlib_resources_backport_read_text_spec.isCompileTimeComputable(
|
|
1393
|
+
(
|
|
1394
|
+
self.subnode_package,
|
|
1395
|
+
self.subnode_resource,
|
|
1396
|
+
self.subnode_encoding,
|
|
1397
|
+
self.subnode_errors,
|
|
1398
|
+
)
|
|
1399
|
+
)
|
|
1400
|
+
):
|
|
1401
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
1402
|
+
|
|
1403
|
+
return self, None, None
|
|
1404
|
+
|
|
1405
|
+
try:
|
|
1406
|
+
return self.replaceWithCompileTimeValue(trace_collection)
|
|
1407
|
+
finally:
|
|
1408
|
+
self.attempted = True
|
|
1409
|
+
|
|
1410
|
+
@abstractmethod
|
|
1411
|
+
def replaceWithCompileTimeValue(self, trace_collection):
|
|
1412
|
+
pass
|
|
1413
|
+
|
|
1414
|
+
@staticmethod
|
|
1415
|
+
def mayRaiseExceptionOperation():
|
|
1416
|
+
return True
|
|
1417
|
+
|
|
1418
|
+
|
|
1419
|
+
class ExpressionImportlibResourcesFilesRef(
|
|
1420
|
+
ExpressionImportModuleNameHardExistsSpecificBase
|
|
1421
|
+
):
|
|
1422
|
+
"""Function reference importlib.resources.files"""
|
|
1423
|
+
|
|
1424
|
+
kind = "EXPRESSION_IMPORTLIB_RESOURCES_FILES_REF"
|
|
1425
|
+
|
|
1426
|
+
def __init__(self, source_ref):
|
|
1427
|
+
ExpressionImportModuleNameHardExistsSpecificBase.__init__(
|
|
1428
|
+
self,
|
|
1429
|
+
module_name="importlib.resources",
|
|
1430
|
+
import_name="files",
|
|
1431
|
+
module_guaranteed=True,
|
|
1432
|
+
source_ref=source_ref,
|
|
1433
|
+
)
|
|
1434
|
+
|
|
1435
|
+
def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):
|
|
1436
|
+
# Anything may happen on call trace before this. On next pass, if
|
|
1437
|
+
# replaced, we might be better but not now.
|
|
1438
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
1439
|
+
|
|
1440
|
+
from .PackageResourceNodes import ExpressionImportlibResourcesFilesCall
|
|
1441
|
+
|
|
1442
|
+
result = extractBuiltinArgs(
|
|
1443
|
+
node=call_node,
|
|
1444
|
+
builtin_class=ExpressionImportlibResourcesFilesCall,
|
|
1445
|
+
builtin_spec=importlib_resources_files_spec,
|
|
1446
|
+
)
|
|
1447
|
+
|
|
1448
|
+
return (
|
|
1449
|
+
result,
|
|
1450
|
+
"new_expression",
|
|
1451
|
+
"Call to 'importlib.resources.files' recognized.",
|
|
1452
|
+
)
|
|
1453
|
+
|
|
1454
|
+
|
|
1455
|
+
hard_import_node_classes[ExpressionImportlibResourcesFilesRef] = (
|
|
1456
|
+
importlib_resources_files_spec
|
|
1457
|
+
)
|
|
1458
|
+
|
|
1459
|
+
|
|
1460
|
+
class ExpressionImportlibResourcesFilesCallBase(
|
|
1461
|
+
ChildHavingPackageMixin, ExpressionBase
|
|
1462
|
+
):
|
|
1463
|
+
"""Base class for ImportlibResourcesFilesCall
|
|
1464
|
+
|
|
1465
|
+
Generated boiler plate code from 'HardImportCallNode.py.j2' template.
|
|
1466
|
+
"""
|
|
1467
|
+
|
|
1468
|
+
named_children = ("package",)
|
|
1469
|
+
|
|
1470
|
+
__slots__ = ("attempted",)
|
|
1471
|
+
|
|
1472
|
+
spec = importlib_resources_files_spec
|
|
1473
|
+
|
|
1474
|
+
def __init__(self, package, source_ref):
|
|
1475
|
+
|
|
1476
|
+
ChildHavingPackageMixin.__init__(
|
|
1477
|
+
self,
|
|
1478
|
+
package=package,
|
|
1479
|
+
)
|
|
1480
|
+
|
|
1481
|
+
ExpressionBase.__init__(self, source_ref)
|
|
1482
|
+
|
|
1483
|
+
self.attempted = False
|
|
1484
|
+
|
|
1485
|
+
def computeExpression(self, trace_collection):
|
|
1486
|
+
if (
|
|
1487
|
+
self.attempted
|
|
1488
|
+
or not importlib_resources_files_spec.isCompileTimeComputable(
|
|
1489
|
+
(self.subnode_package,)
|
|
1490
|
+
)
|
|
1491
|
+
):
|
|
1492
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
1493
|
+
|
|
1494
|
+
return self, None, None
|
|
1495
|
+
|
|
1496
|
+
try:
|
|
1497
|
+
return self.replaceWithCompileTimeValue(trace_collection)
|
|
1498
|
+
finally:
|
|
1499
|
+
self.attempted = True
|
|
1500
|
+
|
|
1501
|
+
@abstractmethod
|
|
1502
|
+
def replaceWithCompileTimeValue(self, trace_collection):
|
|
1503
|
+
pass
|
|
1504
|
+
|
|
1505
|
+
@staticmethod
|
|
1506
|
+
def mayRaiseExceptionOperation():
|
|
1507
|
+
return True
|
|
1508
|
+
|
|
1509
|
+
|
|
1510
|
+
class ExpressionImportlibResourcesReadBinaryRef(
|
|
1511
|
+
ExpressionImportModuleNameHardExistsSpecificBase
|
|
1512
|
+
):
|
|
1513
|
+
"""Function reference importlib.resources.read_binary"""
|
|
1514
|
+
|
|
1515
|
+
kind = "EXPRESSION_IMPORTLIB_RESOURCES_READ_BINARY_REF"
|
|
1516
|
+
|
|
1517
|
+
def __init__(self, source_ref):
|
|
1518
|
+
ExpressionImportModuleNameHardExistsSpecificBase.__init__(
|
|
1519
|
+
self,
|
|
1520
|
+
module_name="importlib.resources",
|
|
1521
|
+
import_name="read_binary",
|
|
1522
|
+
module_guaranteed=True,
|
|
1523
|
+
source_ref=source_ref,
|
|
1524
|
+
)
|
|
1525
|
+
|
|
1526
|
+
def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):
|
|
1527
|
+
# Anything may happen on call trace before this. On next pass, if
|
|
1528
|
+
# replaced, we might be better but not now.
|
|
1529
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
1530
|
+
|
|
1531
|
+
from .PackageResourceNodes import (
|
|
1532
|
+
ExpressionImportlibResourcesReadBinaryCall,
|
|
1533
|
+
)
|
|
1534
|
+
|
|
1535
|
+
result = extractBuiltinArgs(
|
|
1536
|
+
node=call_node,
|
|
1537
|
+
builtin_class=ExpressionImportlibResourcesReadBinaryCall,
|
|
1538
|
+
builtin_spec=importlib_resources_read_binary_spec,
|
|
1539
|
+
)
|
|
1540
|
+
|
|
1541
|
+
return (
|
|
1542
|
+
result,
|
|
1543
|
+
"new_expression",
|
|
1544
|
+
"Call to 'importlib.resources.read_binary' recognized.",
|
|
1545
|
+
)
|
|
1546
|
+
|
|
1547
|
+
|
|
1548
|
+
hard_import_node_classes[ExpressionImportlibResourcesReadBinaryRef] = (
|
|
1549
|
+
importlib_resources_read_binary_spec
|
|
1550
|
+
)
|
|
1551
|
+
|
|
1552
|
+
|
|
1553
|
+
class ExpressionImportlibResourcesReadBinaryCallBase(
|
|
1554
|
+
ExpressionBytesShapeExactMixin, ChildrenHavingPackageResourceMixin, ExpressionBase
|
|
1555
|
+
):
|
|
1556
|
+
"""Base class for ImportlibResourcesReadBinaryCall
|
|
1557
|
+
|
|
1558
|
+
Generated boiler plate code from 'HardImportCallNode.py.j2' template.
|
|
1559
|
+
"""
|
|
1560
|
+
|
|
1561
|
+
named_children = (
|
|
1562
|
+
"package",
|
|
1563
|
+
"resource",
|
|
1564
|
+
)
|
|
1565
|
+
|
|
1566
|
+
__slots__ = ("attempted",)
|
|
1567
|
+
|
|
1568
|
+
spec = importlib_resources_read_binary_spec
|
|
1569
|
+
|
|
1570
|
+
def __init__(self, package, resource, source_ref):
|
|
1571
|
+
|
|
1572
|
+
ChildrenHavingPackageResourceMixin.__init__(
|
|
1573
|
+
self,
|
|
1574
|
+
package=package,
|
|
1575
|
+
resource=resource,
|
|
1576
|
+
)
|
|
1577
|
+
|
|
1578
|
+
ExpressionBase.__init__(self, source_ref)
|
|
1579
|
+
|
|
1580
|
+
self.attempted = False
|
|
1581
|
+
|
|
1582
|
+
def computeExpression(self, trace_collection):
|
|
1583
|
+
if (
|
|
1584
|
+
self.attempted
|
|
1585
|
+
or not importlib_resources_read_binary_spec.isCompileTimeComputable(
|
|
1586
|
+
(
|
|
1587
|
+
self.subnode_package,
|
|
1588
|
+
self.subnode_resource,
|
|
1589
|
+
)
|
|
1590
|
+
)
|
|
1591
|
+
):
|
|
1592
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
1593
|
+
|
|
1594
|
+
return self, None, None
|
|
1595
|
+
|
|
1596
|
+
try:
|
|
1597
|
+
return self.replaceWithCompileTimeValue(trace_collection)
|
|
1598
|
+
finally:
|
|
1599
|
+
self.attempted = True
|
|
1600
|
+
|
|
1601
|
+
@abstractmethod
|
|
1602
|
+
def replaceWithCompileTimeValue(self, trace_collection):
|
|
1603
|
+
pass
|
|
1604
|
+
|
|
1605
|
+
@staticmethod
|
|
1606
|
+
def mayRaiseExceptionOperation():
|
|
1607
|
+
return True
|
|
1608
|
+
|
|
1609
|
+
|
|
1610
|
+
class ExpressionImportlibResourcesReadTextRef(
|
|
1611
|
+
ExpressionImportModuleNameHardExistsSpecificBase
|
|
1612
|
+
):
|
|
1613
|
+
"""Function reference importlib.resources.read_text"""
|
|
1614
|
+
|
|
1615
|
+
kind = "EXPRESSION_IMPORTLIB_RESOURCES_READ_TEXT_REF"
|
|
1616
|
+
|
|
1617
|
+
def __init__(self, source_ref):
|
|
1618
|
+
ExpressionImportModuleNameHardExistsSpecificBase.__init__(
|
|
1619
|
+
self,
|
|
1620
|
+
module_name="importlib.resources",
|
|
1621
|
+
import_name="read_text",
|
|
1622
|
+
module_guaranteed=True,
|
|
1623
|
+
source_ref=source_ref,
|
|
1624
|
+
)
|
|
1625
|
+
|
|
1626
|
+
def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):
|
|
1627
|
+
# Anything may happen on call trace before this. On next pass, if
|
|
1628
|
+
# replaced, we might be better but not now.
|
|
1629
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
1630
|
+
|
|
1631
|
+
if python_version >= 0x3D0:
|
|
1632
|
+
from .PackageResourceNodes import (
|
|
1633
|
+
makeExpressionImportlibResourcesReadTextSince313Call,
|
|
1634
|
+
)
|
|
1635
|
+
|
|
1636
|
+
result = extractBuiltinArgs(
|
|
1637
|
+
node=call_node,
|
|
1638
|
+
builtin_class=makeExpressionImportlibResourcesReadTextSince313Call,
|
|
1639
|
+
builtin_spec=importlib_resources_read_text_since_313_spec,
|
|
1640
|
+
)
|
|
1641
|
+
|
|
1642
|
+
return (
|
|
1643
|
+
result,
|
|
1644
|
+
"new_expression",
|
|
1645
|
+
"Call to 'importlib.resources.read_text' recognized.",
|
|
1646
|
+
)
|
|
1647
|
+
|
|
1648
|
+
if python_version < 0x3D0:
|
|
1649
|
+
from .PackageResourceNodes import (
|
|
1650
|
+
makeExpressionImportlibResourcesReadTextBefore313Call,
|
|
1651
|
+
)
|
|
1652
|
+
|
|
1653
|
+
result = extractBuiltinArgs(
|
|
1654
|
+
node=call_node,
|
|
1655
|
+
builtin_class=makeExpressionImportlibResourcesReadTextBefore313Call,
|
|
1656
|
+
builtin_spec=importlib_resources_read_text_before_313_spec,
|
|
1657
|
+
)
|
|
1658
|
+
|
|
1659
|
+
return (
|
|
1660
|
+
result,
|
|
1661
|
+
"new_expression",
|
|
1662
|
+
"Call to 'importlib.resources.read_text' recognized.",
|
|
1663
|
+
)
|
|
1664
|
+
|
|
1665
|
+
|
|
1666
|
+
hard_import_node_classes[ExpressionImportlibResourcesReadTextRef] = (
|
|
1667
|
+
importlib_resources_read_text_since_313_spec
|
|
1668
|
+
)
|
|
1669
|
+
|
|
1670
|
+
|
|
1671
|
+
class ExpressionImportlibResourcesReadTextSince313CallBase(
|
|
1672
|
+
ExpressionStrShapeExactMixin,
|
|
1673
|
+
ChildrenHavingPackageOptionalResourcesTupleEncodingOptionalErrorsOptionalMixin,
|
|
1674
|
+
ExpressionBase,
|
|
1675
|
+
):
|
|
1676
|
+
"""Base class for ImportlibResourcesReadTextCall
|
|
1677
|
+
|
|
1678
|
+
Generated boiler plate code from 'HardImportCallNode.py.j2' template.
|
|
1679
|
+
"""
|
|
1680
|
+
|
|
1681
|
+
python_version_spec = ">= 0x3d0"
|
|
1682
|
+
|
|
1683
|
+
named_children = (
|
|
1684
|
+
"package|optional",
|
|
1685
|
+
"resources|tuple",
|
|
1686
|
+
"encoding|optional",
|
|
1687
|
+
"errors|optional",
|
|
1688
|
+
)
|
|
1689
|
+
|
|
1690
|
+
__slots__ = ("attempted",)
|
|
1691
|
+
|
|
1692
|
+
spec = importlib_resources_read_text_since_313_spec
|
|
1693
|
+
|
|
1694
|
+
def __init__(self, package, resources, encoding, errors, source_ref):
|
|
1695
|
+
|
|
1696
|
+
ChildrenHavingPackageOptionalResourcesTupleEncodingOptionalErrorsOptionalMixin.__init__(
|
|
1697
|
+
self,
|
|
1698
|
+
package=package,
|
|
1699
|
+
resources=resources,
|
|
1700
|
+
encoding=encoding,
|
|
1701
|
+
errors=errors,
|
|
1702
|
+
)
|
|
1703
|
+
|
|
1704
|
+
ExpressionBase.__init__(self, source_ref)
|
|
1705
|
+
|
|
1706
|
+
self.attempted = False
|
|
1707
|
+
|
|
1708
|
+
def computeExpression(self, trace_collection):
|
|
1709
|
+
if (
|
|
1710
|
+
self.attempted
|
|
1711
|
+
or not importlib_resources_read_text_since_313_spec.isCompileTimeComputable(
|
|
1712
|
+
(self.subnode_package,) + self.subnode_resources
|
|
1713
|
+
)
|
|
1714
|
+
):
|
|
1715
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
1716
|
+
|
|
1717
|
+
return self, None, None
|
|
1718
|
+
|
|
1719
|
+
try:
|
|
1720
|
+
return self.replaceWithCompileTimeValue(trace_collection)
|
|
1721
|
+
finally:
|
|
1722
|
+
self.attempted = True
|
|
1723
|
+
|
|
1724
|
+
@abstractmethod
|
|
1725
|
+
def replaceWithCompileTimeValue(self, trace_collection):
|
|
1726
|
+
pass
|
|
1727
|
+
|
|
1728
|
+
@staticmethod
|
|
1729
|
+
def mayRaiseExceptionOperation():
|
|
1730
|
+
return True
|
|
1731
|
+
|
|
1732
|
+
|
|
1733
|
+
class ExpressionImportlibResourcesReadTextBefore313CallBase(
|
|
1734
|
+
ExpressionStrShapeExactMixin,
|
|
1735
|
+
ChildrenHavingPackageResourceEncodingOptionalErrorsOptionalMixin,
|
|
1736
|
+
ExpressionBase,
|
|
1737
|
+
):
|
|
1738
|
+
"""Base class for ImportlibResourcesReadTextCall
|
|
1739
|
+
|
|
1740
|
+
Generated boiler plate code from 'HardImportCallNode.py.j2' template.
|
|
1741
|
+
"""
|
|
1742
|
+
|
|
1743
|
+
python_version_spec = "< 0x3d0"
|
|
1744
|
+
|
|
1745
|
+
named_children = (
|
|
1746
|
+
"package",
|
|
1747
|
+
"resource",
|
|
1748
|
+
"encoding|optional",
|
|
1749
|
+
"errors|optional",
|
|
1750
|
+
)
|
|
1751
|
+
|
|
1752
|
+
__slots__ = ("attempted",)
|
|
1753
|
+
|
|
1754
|
+
spec = importlib_resources_read_text_before_313_spec
|
|
1755
|
+
|
|
1756
|
+
def __init__(self, package, resource, encoding, errors, source_ref):
|
|
1757
|
+
|
|
1758
|
+
ChildrenHavingPackageResourceEncodingOptionalErrorsOptionalMixin.__init__(
|
|
1759
|
+
self,
|
|
1760
|
+
package=package,
|
|
1761
|
+
resource=resource,
|
|
1762
|
+
encoding=encoding,
|
|
1763
|
+
errors=errors,
|
|
1764
|
+
)
|
|
1765
|
+
|
|
1766
|
+
ExpressionBase.__init__(self, source_ref)
|
|
1767
|
+
|
|
1768
|
+
self.attempted = False
|
|
1769
|
+
|
|
1770
|
+
def computeExpression(self, trace_collection):
|
|
1771
|
+
if (
|
|
1772
|
+
self.attempted
|
|
1773
|
+
or not importlib_resources_read_text_before_313_spec.isCompileTimeComputable(
|
|
1774
|
+
(
|
|
1775
|
+
self.subnode_package,
|
|
1776
|
+
self.subnode_resource,
|
|
1777
|
+
self.subnode_encoding,
|
|
1778
|
+
self.subnode_errors,
|
|
1779
|
+
)
|
|
1780
|
+
)
|
|
1781
|
+
):
|
|
1782
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
1783
|
+
|
|
1784
|
+
return self, None, None
|
|
1785
|
+
|
|
1786
|
+
try:
|
|
1787
|
+
return self.replaceWithCompileTimeValue(trace_collection)
|
|
1788
|
+
finally:
|
|
1789
|
+
self.attempted = True
|
|
1790
|
+
|
|
1791
|
+
@abstractmethod
|
|
1792
|
+
def replaceWithCompileTimeValue(self, trace_collection):
|
|
1793
|
+
pass
|
|
1794
|
+
|
|
1795
|
+
@staticmethod
|
|
1796
|
+
def mayRaiseExceptionOperation():
|
|
1797
|
+
return True
|
|
1798
|
+
|
|
1799
|
+
|
|
1800
|
+
class ExpressionOsListdirRef(ExpressionImportModuleNameHardExistsSpecificBase):
|
|
1801
|
+
"""Function reference os.listdir"""
|
|
1802
|
+
|
|
1803
|
+
kind = "EXPRESSION_OS_LISTDIR_REF"
|
|
1804
|
+
|
|
1805
|
+
def __init__(self, source_ref):
|
|
1806
|
+
ExpressionImportModuleNameHardExistsSpecificBase.__init__(
|
|
1807
|
+
self,
|
|
1808
|
+
module_name="os",
|
|
1809
|
+
import_name="listdir",
|
|
1810
|
+
module_guaranteed=True,
|
|
1811
|
+
source_ref=source_ref,
|
|
1812
|
+
)
|
|
1813
|
+
|
|
1814
|
+
def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):
|
|
1815
|
+
# Anything may happen on call trace before this. On next pass, if
|
|
1816
|
+
# replaced, we might be better but not now.
|
|
1817
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
1818
|
+
|
|
1819
|
+
from .OsSysNodes import ExpressionOsListdirCall
|
|
1820
|
+
|
|
1821
|
+
result = extractBuiltinArgs(
|
|
1822
|
+
node=call_node,
|
|
1823
|
+
builtin_class=ExpressionOsListdirCall,
|
|
1824
|
+
builtin_spec=os_listdir_spec,
|
|
1825
|
+
)
|
|
1826
|
+
|
|
1827
|
+
return (
|
|
1828
|
+
result,
|
|
1829
|
+
"new_expression",
|
|
1830
|
+
"Call to 'os.listdir' recognized.",
|
|
1831
|
+
)
|
|
1832
|
+
|
|
1833
|
+
|
|
1834
|
+
hard_import_node_classes[ExpressionOsListdirRef] = os_listdir_spec
|
|
1835
|
+
|
|
1836
|
+
|
|
1837
|
+
class ExpressionOsListdirCallBase(ChildHavingPathOptionalMixin, ExpressionBase):
|
|
1838
|
+
"""Base class for OsListdirCall
|
|
1839
|
+
|
|
1840
|
+
Generated boiler plate code from 'HardImportCallNode.py.j2' template.
|
|
1841
|
+
"""
|
|
1842
|
+
|
|
1843
|
+
named_children = ("path|optional",)
|
|
1844
|
+
|
|
1845
|
+
__slots__ = ("attempted",)
|
|
1846
|
+
|
|
1847
|
+
spec = os_listdir_spec
|
|
1848
|
+
|
|
1849
|
+
def __init__(self, path, source_ref):
|
|
1850
|
+
|
|
1851
|
+
ChildHavingPathOptionalMixin.__init__(
|
|
1852
|
+
self,
|
|
1853
|
+
path=path,
|
|
1854
|
+
)
|
|
1855
|
+
|
|
1856
|
+
ExpressionBase.__init__(self, source_ref)
|
|
1857
|
+
|
|
1858
|
+
self.attempted = False
|
|
1859
|
+
|
|
1860
|
+
def computeExpression(self, trace_collection):
|
|
1861
|
+
if self.attempted or not os_listdir_spec.isCompileTimeComputable(
|
|
1862
|
+
(self.subnode_path,)
|
|
1863
|
+
):
|
|
1864
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
1865
|
+
|
|
1866
|
+
return self, None, None
|
|
1867
|
+
|
|
1868
|
+
try:
|
|
1869
|
+
return self.replaceWithCompileTimeValue(trace_collection)
|
|
1870
|
+
finally:
|
|
1871
|
+
self.attempted = True
|
|
1872
|
+
|
|
1873
|
+
@abstractmethod
|
|
1874
|
+
def replaceWithCompileTimeValue(self, trace_collection):
|
|
1875
|
+
pass
|
|
1876
|
+
|
|
1877
|
+
@staticmethod
|
|
1878
|
+
def mayRaiseExceptionOperation():
|
|
1879
|
+
return True
|
|
1880
|
+
|
|
1881
|
+
|
|
1882
|
+
class ExpressionOsLstatRef(ExpressionImportModuleNameHardExistsSpecificBase):
|
|
1883
|
+
"""Function reference os.lstat"""
|
|
1884
|
+
|
|
1885
|
+
kind = "EXPRESSION_OS_LSTAT_REF"
|
|
1886
|
+
|
|
1887
|
+
def __init__(self, source_ref):
|
|
1888
|
+
ExpressionImportModuleNameHardExistsSpecificBase.__init__(
|
|
1889
|
+
self,
|
|
1890
|
+
module_name="os",
|
|
1891
|
+
import_name="lstat",
|
|
1892
|
+
module_guaranteed=True,
|
|
1893
|
+
source_ref=source_ref,
|
|
1894
|
+
)
|
|
1895
|
+
|
|
1896
|
+
def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):
|
|
1897
|
+
# Anything may happen on call trace before this. On next pass, if
|
|
1898
|
+
# replaced, we might be better but not now.
|
|
1899
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
1900
|
+
|
|
1901
|
+
from .OsSysNodes import ExpressionOsLstatCall
|
|
1902
|
+
|
|
1903
|
+
result = extractBuiltinArgs(
|
|
1904
|
+
node=call_node,
|
|
1905
|
+
builtin_class=ExpressionOsLstatCall,
|
|
1906
|
+
builtin_spec=os_lstat_spec,
|
|
1907
|
+
)
|
|
1908
|
+
|
|
1909
|
+
return (
|
|
1910
|
+
result,
|
|
1911
|
+
"new_expression",
|
|
1912
|
+
"Call to 'os.lstat' recognized.",
|
|
1913
|
+
)
|
|
1914
|
+
|
|
1915
|
+
|
|
1916
|
+
hard_import_node_classes[ExpressionOsLstatRef] = os_lstat_spec
|
|
1917
|
+
|
|
1918
|
+
|
|
1919
|
+
class ExpressionOsLstatCallBase(
|
|
1920
|
+
ChildrenHavingPathOptionalDirFdOptionalMixin, ExpressionBase
|
|
1921
|
+
):
|
|
1922
|
+
"""Base class for OsLstatCall
|
|
1923
|
+
|
|
1924
|
+
Generated boiler plate code from 'HardImportCallNode.py.j2' template.
|
|
1925
|
+
"""
|
|
1926
|
+
|
|
1927
|
+
named_children = (
|
|
1928
|
+
"path|optional",
|
|
1929
|
+
"dir_fd|optional",
|
|
1930
|
+
)
|
|
1931
|
+
|
|
1932
|
+
__slots__ = ("attempted",)
|
|
1933
|
+
|
|
1934
|
+
spec = os_lstat_spec
|
|
1935
|
+
|
|
1936
|
+
def __init__(self, path, dir_fd, source_ref):
|
|
1937
|
+
|
|
1938
|
+
ChildrenHavingPathOptionalDirFdOptionalMixin.__init__(
|
|
1939
|
+
self,
|
|
1940
|
+
path=path,
|
|
1941
|
+
dir_fd=dir_fd,
|
|
1942
|
+
)
|
|
1943
|
+
|
|
1944
|
+
ExpressionBase.__init__(self, source_ref)
|
|
1945
|
+
|
|
1946
|
+
self.attempted = False
|
|
1947
|
+
|
|
1948
|
+
def computeExpression(self, trace_collection):
|
|
1949
|
+
if self.attempted or not os_lstat_spec.isCompileTimeComputable(
|
|
1950
|
+
(self.subnode_path,)
|
|
1951
|
+
):
|
|
1952
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
1953
|
+
|
|
1954
|
+
return self, None, None
|
|
1955
|
+
|
|
1956
|
+
try:
|
|
1957
|
+
return self.replaceWithCompileTimeValue(trace_collection)
|
|
1958
|
+
finally:
|
|
1959
|
+
self.attempted = True
|
|
1960
|
+
|
|
1961
|
+
@abstractmethod
|
|
1962
|
+
def replaceWithCompileTimeValue(self, trace_collection):
|
|
1963
|
+
pass
|
|
1964
|
+
|
|
1965
|
+
@staticmethod
|
|
1966
|
+
def mayRaiseExceptionOperation():
|
|
1967
|
+
return True
|
|
1968
|
+
|
|
1969
|
+
|
|
1970
|
+
class ExpressionOsPathAbspathRef(ExpressionImportModuleNameHardExistsSpecificBase):
|
|
1971
|
+
"""Function reference os.path.abspath"""
|
|
1972
|
+
|
|
1973
|
+
kind = "EXPRESSION_OS_PATH_ABSPATH_REF"
|
|
1974
|
+
|
|
1975
|
+
def __init__(self, source_ref):
|
|
1976
|
+
ExpressionImportModuleNameHardExistsSpecificBase.__init__(
|
|
1977
|
+
self,
|
|
1978
|
+
module_name=os.path.__name__,
|
|
1979
|
+
import_name="abspath",
|
|
1980
|
+
module_guaranteed=True,
|
|
1981
|
+
source_ref=source_ref,
|
|
1982
|
+
)
|
|
1983
|
+
|
|
1984
|
+
def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):
|
|
1985
|
+
# Anything may happen on call trace before this. On next pass, if
|
|
1986
|
+
# replaced, we might be better but not now.
|
|
1987
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
1988
|
+
|
|
1989
|
+
from .OsSysNodes import ExpressionOsPathAbspathCall
|
|
1990
|
+
|
|
1991
|
+
result = extractBuiltinArgs(
|
|
1992
|
+
node=call_node,
|
|
1993
|
+
builtin_class=ExpressionOsPathAbspathCall,
|
|
1994
|
+
builtin_spec=os_path_abspath_spec,
|
|
1995
|
+
)
|
|
1996
|
+
|
|
1997
|
+
return (
|
|
1998
|
+
result,
|
|
1999
|
+
"new_expression",
|
|
2000
|
+
"Call to 'os.path.abspath' recognized.",
|
|
2001
|
+
)
|
|
2002
|
+
|
|
2003
|
+
|
|
2004
|
+
hard_import_node_classes[ExpressionOsPathAbspathRef] = os_path_abspath_spec
|
|
2005
|
+
|
|
2006
|
+
|
|
2007
|
+
class ExpressionOsPathAbspathCallBase(ChildHavingPathMixin, ExpressionBase):
|
|
2008
|
+
"""Base class for OsPathAbspathCall
|
|
2009
|
+
|
|
2010
|
+
Generated boiler plate code from 'HardImportCallNode.py.j2' template.
|
|
2011
|
+
"""
|
|
2012
|
+
|
|
2013
|
+
named_children = ("path",)
|
|
2014
|
+
|
|
2015
|
+
__slots__ = ("attempted",)
|
|
2016
|
+
|
|
2017
|
+
spec = os_path_abspath_spec
|
|
2018
|
+
|
|
2019
|
+
def __init__(self, path, source_ref):
|
|
2020
|
+
|
|
2021
|
+
ChildHavingPathMixin.__init__(
|
|
2022
|
+
self,
|
|
2023
|
+
path=path,
|
|
2024
|
+
)
|
|
2025
|
+
|
|
2026
|
+
ExpressionBase.__init__(self, source_ref)
|
|
2027
|
+
|
|
2028
|
+
self.attempted = False
|
|
2029
|
+
|
|
2030
|
+
def computeExpression(self, trace_collection):
|
|
2031
|
+
if self.attempted or not os_path_abspath_spec.isCompileTimeComputable(
|
|
2032
|
+
(self.subnode_path,)
|
|
2033
|
+
):
|
|
2034
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
2035
|
+
|
|
2036
|
+
return self, None, None
|
|
2037
|
+
|
|
2038
|
+
try:
|
|
2039
|
+
return self.replaceWithCompileTimeValue(trace_collection)
|
|
2040
|
+
finally:
|
|
2041
|
+
self.attempted = True
|
|
2042
|
+
|
|
2043
|
+
@abstractmethod
|
|
2044
|
+
def replaceWithCompileTimeValue(self, trace_collection):
|
|
2045
|
+
pass
|
|
2046
|
+
|
|
2047
|
+
@staticmethod
|
|
2048
|
+
def mayRaiseExceptionOperation():
|
|
2049
|
+
return True
|
|
2050
|
+
|
|
2051
|
+
|
|
2052
|
+
class ExpressionOsPathBasenameRef(ExpressionImportModuleNameHardExistsSpecificBase):
|
|
2053
|
+
"""Function reference os.path.basename"""
|
|
2054
|
+
|
|
2055
|
+
kind = "EXPRESSION_OS_PATH_BASENAME_REF"
|
|
2056
|
+
|
|
2057
|
+
def __init__(self, source_ref):
|
|
2058
|
+
ExpressionImportModuleNameHardExistsSpecificBase.__init__(
|
|
2059
|
+
self,
|
|
2060
|
+
module_name=os.path.__name__,
|
|
2061
|
+
import_name="basename",
|
|
2062
|
+
module_guaranteed=True,
|
|
2063
|
+
source_ref=source_ref,
|
|
2064
|
+
)
|
|
2065
|
+
|
|
2066
|
+
def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):
|
|
2067
|
+
# Anything may happen on call trace before this. On next pass, if
|
|
2068
|
+
# replaced, we might be better but not now.
|
|
2069
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
2070
|
+
|
|
2071
|
+
from .OsSysNodes import ExpressionOsPathBasenameCall
|
|
2072
|
+
|
|
2073
|
+
result = extractBuiltinArgs(
|
|
2074
|
+
node=call_node,
|
|
2075
|
+
builtin_class=ExpressionOsPathBasenameCall,
|
|
2076
|
+
builtin_spec=os_path_basename_spec,
|
|
2077
|
+
)
|
|
2078
|
+
|
|
2079
|
+
return (
|
|
2080
|
+
result,
|
|
2081
|
+
"new_expression",
|
|
2082
|
+
"Call to 'os.path.basename' recognized.",
|
|
2083
|
+
)
|
|
2084
|
+
|
|
2085
|
+
|
|
2086
|
+
hard_import_node_classes[ExpressionOsPathBasenameRef] = os_path_basename_spec
|
|
2087
|
+
|
|
2088
|
+
|
|
2089
|
+
class ExpressionOsPathBasenameCallBase(ChildHavingPMixin, ExpressionBase):
|
|
2090
|
+
"""Base class for OsPathBasenameCall
|
|
2091
|
+
|
|
2092
|
+
Generated boiler plate code from 'HardImportCallNode.py.j2' template.
|
|
2093
|
+
"""
|
|
2094
|
+
|
|
2095
|
+
named_children = ("p",)
|
|
2096
|
+
|
|
2097
|
+
__slots__ = ("attempted",)
|
|
2098
|
+
|
|
2099
|
+
spec = os_path_basename_spec
|
|
2100
|
+
|
|
2101
|
+
def __init__(self, p, source_ref):
|
|
2102
|
+
|
|
2103
|
+
ChildHavingPMixin.__init__(
|
|
2104
|
+
self,
|
|
2105
|
+
p=p,
|
|
2106
|
+
)
|
|
2107
|
+
|
|
2108
|
+
ExpressionBase.__init__(self, source_ref)
|
|
2109
|
+
|
|
2110
|
+
self.attempted = False
|
|
2111
|
+
|
|
2112
|
+
def computeExpression(self, trace_collection):
|
|
2113
|
+
if self.attempted or not os_path_basename_spec.isCompileTimeComputable(
|
|
2114
|
+
(self.subnode_p,)
|
|
2115
|
+
):
|
|
2116
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
2117
|
+
|
|
2118
|
+
return self, None, None
|
|
2119
|
+
|
|
2120
|
+
try:
|
|
2121
|
+
return self.replaceWithCompileTimeValue(trace_collection)
|
|
2122
|
+
finally:
|
|
2123
|
+
self.attempted = True
|
|
2124
|
+
|
|
2125
|
+
@abstractmethod
|
|
2126
|
+
def replaceWithCompileTimeValue(self, trace_collection):
|
|
2127
|
+
pass
|
|
2128
|
+
|
|
2129
|
+
@staticmethod
|
|
2130
|
+
def mayRaiseExceptionOperation():
|
|
2131
|
+
return True
|
|
2132
|
+
|
|
2133
|
+
|
|
2134
|
+
class ExpressionOsPathDirnameRef(ExpressionImportModuleNameHardExistsSpecificBase):
|
|
2135
|
+
"""Function reference os.path.dirname"""
|
|
2136
|
+
|
|
2137
|
+
kind = "EXPRESSION_OS_PATH_DIRNAME_REF"
|
|
2138
|
+
|
|
2139
|
+
def __init__(self, source_ref):
|
|
2140
|
+
ExpressionImportModuleNameHardExistsSpecificBase.__init__(
|
|
2141
|
+
self,
|
|
2142
|
+
module_name=os.path.__name__,
|
|
2143
|
+
import_name="dirname",
|
|
2144
|
+
module_guaranteed=True,
|
|
2145
|
+
source_ref=source_ref,
|
|
2146
|
+
)
|
|
2147
|
+
|
|
2148
|
+
def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):
|
|
2149
|
+
# Anything may happen on call trace before this. On next pass, if
|
|
2150
|
+
# replaced, we might be better but not now.
|
|
2151
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
2152
|
+
|
|
2153
|
+
from .OsSysNodes import ExpressionOsPathDirnameCall
|
|
2154
|
+
|
|
2155
|
+
result = extractBuiltinArgs(
|
|
2156
|
+
node=call_node,
|
|
2157
|
+
builtin_class=ExpressionOsPathDirnameCall,
|
|
2158
|
+
builtin_spec=os_path_dirname_spec,
|
|
2159
|
+
)
|
|
2160
|
+
|
|
2161
|
+
return (
|
|
2162
|
+
result,
|
|
2163
|
+
"new_expression",
|
|
2164
|
+
"Call to 'os.path.dirname' recognized.",
|
|
2165
|
+
)
|
|
2166
|
+
|
|
2167
|
+
|
|
2168
|
+
hard_import_node_classes[ExpressionOsPathDirnameRef] = os_path_dirname_spec
|
|
2169
|
+
|
|
2170
|
+
|
|
2171
|
+
class ExpressionOsPathDirnameCallBase(ChildHavingPMixin, ExpressionBase):
|
|
2172
|
+
"""Base class for OsPathDirnameCall
|
|
2173
|
+
|
|
2174
|
+
Generated boiler plate code from 'HardImportCallNode.py.j2' template.
|
|
2175
|
+
"""
|
|
2176
|
+
|
|
2177
|
+
named_children = ("p",)
|
|
2178
|
+
|
|
2179
|
+
__slots__ = ("attempted",)
|
|
2180
|
+
|
|
2181
|
+
spec = os_path_dirname_spec
|
|
2182
|
+
|
|
2183
|
+
def __init__(self, p, source_ref):
|
|
2184
|
+
|
|
2185
|
+
ChildHavingPMixin.__init__(
|
|
2186
|
+
self,
|
|
2187
|
+
p=p,
|
|
2188
|
+
)
|
|
2189
|
+
|
|
2190
|
+
ExpressionBase.__init__(self, source_ref)
|
|
2191
|
+
|
|
2192
|
+
self.attempted = False
|
|
2193
|
+
|
|
2194
|
+
def computeExpression(self, trace_collection):
|
|
2195
|
+
if self.attempted or not os_path_dirname_spec.isCompileTimeComputable(
|
|
2196
|
+
(self.subnode_p,)
|
|
2197
|
+
):
|
|
2198
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
2199
|
+
|
|
2200
|
+
return self, None, None
|
|
2201
|
+
|
|
2202
|
+
try:
|
|
2203
|
+
return self.replaceWithCompileTimeValue(trace_collection)
|
|
2204
|
+
finally:
|
|
2205
|
+
self.attempted = True
|
|
2206
|
+
|
|
2207
|
+
@abstractmethod
|
|
2208
|
+
def replaceWithCompileTimeValue(self, trace_collection):
|
|
2209
|
+
pass
|
|
2210
|
+
|
|
2211
|
+
@staticmethod
|
|
2212
|
+
def mayRaiseExceptionOperation():
|
|
2213
|
+
return True
|
|
2214
|
+
|
|
2215
|
+
|
|
2216
|
+
class ExpressionOsPathExistsRef(ExpressionImportModuleNameHardExistsSpecificBase):
|
|
2217
|
+
"""Function reference os.path.exists"""
|
|
2218
|
+
|
|
2219
|
+
kind = "EXPRESSION_OS_PATH_EXISTS_REF"
|
|
2220
|
+
|
|
2221
|
+
def __init__(self, source_ref):
|
|
2222
|
+
ExpressionImportModuleNameHardExistsSpecificBase.__init__(
|
|
2223
|
+
self,
|
|
2224
|
+
module_name=os.path.__name__,
|
|
2225
|
+
import_name="exists",
|
|
2226
|
+
module_guaranteed=True,
|
|
2227
|
+
source_ref=source_ref,
|
|
2228
|
+
)
|
|
2229
|
+
|
|
2230
|
+
def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):
|
|
2231
|
+
# Anything may happen on call trace before this. On next pass, if
|
|
2232
|
+
# replaced, we might be better but not now.
|
|
2233
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
2234
|
+
|
|
2235
|
+
from .OsSysNodes import ExpressionOsPathExistsCall
|
|
2236
|
+
|
|
2237
|
+
result = extractBuiltinArgs(
|
|
2238
|
+
node=call_node,
|
|
2239
|
+
builtin_class=ExpressionOsPathExistsCall,
|
|
2240
|
+
builtin_spec=os_path_exists_spec,
|
|
2241
|
+
)
|
|
2242
|
+
|
|
2243
|
+
return (
|
|
2244
|
+
result,
|
|
2245
|
+
"new_expression",
|
|
2246
|
+
"Call to 'os.path.exists' recognized.",
|
|
2247
|
+
)
|
|
2248
|
+
|
|
2249
|
+
|
|
2250
|
+
hard_import_node_classes[ExpressionOsPathExistsRef] = os_path_exists_spec
|
|
2251
|
+
|
|
2252
|
+
|
|
2253
|
+
class ExpressionOsPathExistsCallBase(ChildHavingPathMixin, ExpressionBase):
|
|
2254
|
+
"""Base class for OsPathExistsCall
|
|
2255
|
+
|
|
2256
|
+
Generated boiler plate code from 'HardImportCallNode.py.j2' template.
|
|
2257
|
+
"""
|
|
2258
|
+
|
|
2259
|
+
named_children = ("path",)
|
|
2260
|
+
|
|
2261
|
+
__slots__ = ("attempted",)
|
|
2262
|
+
|
|
2263
|
+
spec = os_path_exists_spec
|
|
2264
|
+
|
|
2265
|
+
def __init__(self, path, source_ref):
|
|
2266
|
+
|
|
2267
|
+
ChildHavingPathMixin.__init__(
|
|
2268
|
+
self,
|
|
2269
|
+
path=path,
|
|
2270
|
+
)
|
|
2271
|
+
|
|
2272
|
+
ExpressionBase.__init__(self, source_ref)
|
|
2273
|
+
|
|
2274
|
+
self.attempted = False
|
|
2275
|
+
|
|
2276
|
+
def computeExpression(self, trace_collection):
|
|
2277
|
+
if self.attempted or not os_path_exists_spec.isCompileTimeComputable(
|
|
2278
|
+
(self.subnode_path,)
|
|
2279
|
+
):
|
|
2280
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
2281
|
+
|
|
2282
|
+
return self, None, None
|
|
2283
|
+
|
|
2284
|
+
try:
|
|
2285
|
+
return self.replaceWithCompileTimeValue(trace_collection)
|
|
2286
|
+
finally:
|
|
2287
|
+
self.attempted = True
|
|
2288
|
+
|
|
2289
|
+
@abstractmethod
|
|
2290
|
+
def replaceWithCompileTimeValue(self, trace_collection):
|
|
2291
|
+
pass
|
|
2292
|
+
|
|
2293
|
+
@staticmethod
|
|
2294
|
+
def mayRaiseExceptionOperation():
|
|
2295
|
+
return True
|
|
2296
|
+
|
|
2297
|
+
|
|
2298
|
+
class ExpressionOsPathIsabsRef(ExpressionImportModuleNameHardExistsSpecificBase):
|
|
2299
|
+
"""Function reference os.path.isabs"""
|
|
2300
|
+
|
|
2301
|
+
kind = "EXPRESSION_OS_PATH_ISABS_REF"
|
|
2302
|
+
|
|
2303
|
+
def __init__(self, source_ref):
|
|
2304
|
+
ExpressionImportModuleNameHardExistsSpecificBase.__init__(
|
|
2305
|
+
self,
|
|
2306
|
+
module_name=os.path.__name__,
|
|
2307
|
+
import_name="isabs",
|
|
2308
|
+
module_guaranteed=True,
|
|
2309
|
+
source_ref=source_ref,
|
|
2310
|
+
)
|
|
2311
|
+
|
|
2312
|
+
def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):
|
|
2313
|
+
# Anything may happen on call trace before this. On next pass, if
|
|
2314
|
+
# replaced, we might be better but not now.
|
|
2315
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
2316
|
+
|
|
2317
|
+
from .OsSysNodes import ExpressionOsPathIsabsCall
|
|
2318
|
+
|
|
2319
|
+
result = extractBuiltinArgs(
|
|
2320
|
+
node=call_node,
|
|
2321
|
+
builtin_class=ExpressionOsPathIsabsCall,
|
|
2322
|
+
builtin_spec=os_path_isabs_spec,
|
|
2323
|
+
)
|
|
2324
|
+
|
|
2325
|
+
return (
|
|
2326
|
+
result,
|
|
2327
|
+
"new_expression",
|
|
2328
|
+
"Call to 'os.path.isabs' recognized.",
|
|
2329
|
+
)
|
|
2330
|
+
|
|
2331
|
+
|
|
2332
|
+
hard_import_node_classes[ExpressionOsPathIsabsRef] = os_path_isabs_spec
|
|
2333
|
+
|
|
2334
|
+
|
|
2335
|
+
class ExpressionOsPathIsabsCallBase(
|
|
2336
|
+
ExpressionBoolShapeExactMixin, ChildHavingSMixin, ExpressionBase
|
|
2337
|
+
):
|
|
2338
|
+
"""Base class for OsPathIsabsCall
|
|
2339
|
+
|
|
2340
|
+
Generated boiler plate code from 'HardImportCallNode.py.j2' template.
|
|
2341
|
+
"""
|
|
2342
|
+
|
|
2343
|
+
named_children = ("s",)
|
|
2344
|
+
|
|
2345
|
+
__slots__ = ("attempted",)
|
|
2346
|
+
|
|
2347
|
+
spec = os_path_isabs_spec
|
|
2348
|
+
|
|
2349
|
+
def __init__(self, s, source_ref):
|
|
2350
|
+
|
|
2351
|
+
ChildHavingSMixin.__init__(
|
|
2352
|
+
self,
|
|
2353
|
+
s=s,
|
|
2354
|
+
)
|
|
2355
|
+
|
|
2356
|
+
ExpressionBase.__init__(self, source_ref)
|
|
2357
|
+
|
|
2358
|
+
self.attempted = False
|
|
2359
|
+
|
|
2360
|
+
def computeExpression(self, trace_collection):
|
|
2361
|
+
if self.attempted or not os_path_isabs_spec.isCompileTimeComputable(
|
|
2362
|
+
(self.subnode_s,)
|
|
2363
|
+
):
|
|
2364
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
2365
|
+
|
|
2366
|
+
return self, None, None
|
|
2367
|
+
|
|
2368
|
+
try:
|
|
2369
|
+
return self.replaceWithCompileTimeValue(trace_collection)
|
|
2370
|
+
finally:
|
|
2371
|
+
self.attempted = True
|
|
2372
|
+
|
|
2373
|
+
@abstractmethod
|
|
2374
|
+
def replaceWithCompileTimeValue(self, trace_collection):
|
|
2375
|
+
pass
|
|
2376
|
+
|
|
2377
|
+
@staticmethod
|
|
2378
|
+
def mayRaiseExceptionOperation():
|
|
2379
|
+
return True
|
|
2380
|
+
|
|
2381
|
+
|
|
2382
|
+
class ExpressionOsPathIsdirRef(ExpressionImportModuleNameHardExistsSpecificBase):
|
|
2383
|
+
"""Function reference os.path.isdir"""
|
|
2384
|
+
|
|
2385
|
+
kind = "EXPRESSION_OS_PATH_ISDIR_REF"
|
|
2386
|
+
|
|
2387
|
+
def __init__(self, source_ref):
|
|
2388
|
+
ExpressionImportModuleNameHardExistsSpecificBase.__init__(
|
|
2389
|
+
self,
|
|
2390
|
+
module_name=os.path.__name__,
|
|
2391
|
+
import_name="isdir",
|
|
2392
|
+
module_guaranteed=True,
|
|
2393
|
+
source_ref=source_ref,
|
|
2394
|
+
)
|
|
2395
|
+
|
|
2396
|
+
def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):
|
|
2397
|
+
# Anything may happen on call trace before this. On next pass, if
|
|
2398
|
+
# replaced, we might be better but not now.
|
|
2399
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
2400
|
+
|
|
2401
|
+
from .OsSysNodes import ExpressionOsPathIsdirCall
|
|
2402
|
+
|
|
2403
|
+
result = extractBuiltinArgs(
|
|
2404
|
+
node=call_node,
|
|
2405
|
+
builtin_class=ExpressionOsPathIsdirCall,
|
|
2406
|
+
builtin_spec=os_path_isdir_spec,
|
|
2407
|
+
)
|
|
2408
|
+
|
|
2409
|
+
return (
|
|
2410
|
+
result,
|
|
2411
|
+
"new_expression",
|
|
2412
|
+
"Call to 'os.path.isdir' recognized.",
|
|
2413
|
+
)
|
|
2414
|
+
|
|
2415
|
+
|
|
2416
|
+
hard_import_node_classes[ExpressionOsPathIsdirRef] = os_path_isdir_spec
|
|
2417
|
+
|
|
2418
|
+
|
|
2419
|
+
class ExpressionOsPathIsdirCallBase(ChildHavingPathMixin, ExpressionBase):
|
|
2420
|
+
"""Base class for OsPathIsdirCall
|
|
2421
|
+
|
|
2422
|
+
Generated boiler plate code from 'HardImportCallNode.py.j2' template.
|
|
2423
|
+
"""
|
|
2424
|
+
|
|
2425
|
+
named_children = ("path",)
|
|
2426
|
+
|
|
2427
|
+
__slots__ = ("attempted",)
|
|
2428
|
+
|
|
2429
|
+
spec = os_path_isdir_spec
|
|
2430
|
+
|
|
2431
|
+
def __init__(self, path, source_ref):
|
|
2432
|
+
|
|
2433
|
+
ChildHavingPathMixin.__init__(
|
|
2434
|
+
self,
|
|
2435
|
+
path=path,
|
|
2436
|
+
)
|
|
2437
|
+
|
|
2438
|
+
ExpressionBase.__init__(self, source_ref)
|
|
2439
|
+
|
|
2440
|
+
self.attempted = False
|
|
2441
|
+
|
|
2442
|
+
def computeExpression(self, trace_collection):
|
|
2443
|
+
if self.attempted or not os_path_isdir_spec.isCompileTimeComputable(
|
|
2444
|
+
(self.subnode_path,)
|
|
2445
|
+
):
|
|
2446
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
2447
|
+
|
|
2448
|
+
return self, None, None
|
|
2449
|
+
|
|
2450
|
+
try:
|
|
2451
|
+
return self.replaceWithCompileTimeValue(trace_collection)
|
|
2452
|
+
finally:
|
|
2453
|
+
self.attempted = True
|
|
2454
|
+
|
|
2455
|
+
@abstractmethod
|
|
2456
|
+
def replaceWithCompileTimeValue(self, trace_collection):
|
|
2457
|
+
pass
|
|
2458
|
+
|
|
2459
|
+
@staticmethod
|
|
2460
|
+
def mayRaiseExceptionOperation():
|
|
2461
|
+
return True
|
|
2462
|
+
|
|
2463
|
+
|
|
2464
|
+
class ExpressionOsPathIsfileRef(ExpressionImportModuleNameHardExistsSpecificBase):
|
|
2465
|
+
"""Function reference os.path.isfile"""
|
|
2466
|
+
|
|
2467
|
+
kind = "EXPRESSION_OS_PATH_ISFILE_REF"
|
|
2468
|
+
|
|
2469
|
+
def __init__(self, source_ref):
|
|
2470
|
+
ExpressionImportModuleNameHardExistsSpecificBase.__init__(
|
|
2471
|
+
self,
|
|
2472
|
+
module_name=os.path.__name__,
|
|
2473
|
+
import_name="isfile",
|
|
2474
|
+
module_guaranteed=True,
|
|
2475
|
+
source_ref=source_ref,
|
|
2476
|
+
)
|
|
2477
|
+
|
|
2478
|
+
def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):
|
|
2479
|
+
# Anything may happen on call trace before this. On next pass, if
|
|
2480
|
+
# replaced, we might be better but not now.
|
|
2481
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
2482
|
+
|
|
2483
|
+
from .OsSysNodes import ExpressionOsPathIsfileCall
|
|
2484
|
+
|
|
2485
|
+
result = extractBuiltinArgs(
|
|
2486
|
+
node=call_node,
|
|
2487
|
+
builtin_class=ExpressionOsPathIsfileCall,
|
|
2488
|
+
builtin_spec=os_path_isfile_spec,
|
|
2489
|
+
)
|
|
2490
|
+
|
|
2491
|
+
return (
|
|
2492
|
+
result,
|
|
2493
|
+
"new_expression",
|
|
2494
|
+
"Call to 'os.path.isfile' recognized.",
|
|
2495
|
+
)
|
|
2496
|
+
|
|
2497
|
+
|
|
2498
|
+
hard_import_node_classes[ExpressionOsPathIsfileRef] = os_path_isfile_spec
|
|
2499
|
+
|
|
2500
|
+
|
|
2501
|
+
class ExpressionOsPathIsfileCallBase(ChildHavingPathMixin, ExpressionBase):
|
|
2502
|
+
"""Base class for OsPathIsfileCall
|
|
2503
|
+
|
|
2504
|
+
Generated boiler plate code from 'HardImportCallNode.py.j2' template.
|
|
2505
|
+
"""
|
|
2506
|
+
|
|
2507
|
+
named_children = ("path",)
|
|
2508
|
+
|
|
2509
|
+
__slots__ = ("attempted",)
|
|
2510
|
+
|
|
2511
|
+
spec = os_path_isfile_spec
|
|
2512
|
+
|
|
2513
|
+
def __init__(self, path, source_ref):
|
|
2514
|
+
|
|
2515
|
+
ChildHavingPathMixin.__init__(
|
|
2516
|
+
self,
|
|
2517
|
+
path=path,
|
|
2518
|
+
)
|
|
2519
|
+
|
|
2520
|
+
ExpressionBase.__init__(self, source_ref)
|
|
2521
|
+
|
|
2522
|
+
self.attempted = False
|
|
2523
|
+
|
|
2524
|
+
def computeExpression(self, trace_collection):
|
|
2525
|
+
if self.attempted or not os_path_isfile_spec.isCompileTimeComputable(
|
|
2526
|
+
(self.subnode_path,)
|
|
2527
|
+
):
|
|
2528
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
2529
|
+
|
|
2530
|
+
return self, None, None
|
|
2531
|
+
|
|
2532
|
+
try:
|
|
2533
|
+
return self.replaceWithCompileTimeValue(trace_collection)
|
|
2534
|
+
finally:
|
|
2535
|
+
self.attempted = True
|
|
2536
|
+
|
|
2537
|
+
@abstractmethod
|
|
2538
|
+
def replaceWithCompileTimeValue(self, trace_collection):
|
|
2539
|
+
pass
|
|
2540
|
+
|
|
2541
|
+
@staticmethod
|
|
2542
|
+
def mayRaiseExceptionOperation():
|
|
2543
|
+
return True
|
|
2544
|
+
|
|
2545
|
+
|
|
2546
|
+
class ExpressionOsPathNormpathRef(ExpressionImportModuleNameHardExistsSpecificBase):
|
|
2547
|
+
"""Function reference os.path.normpath"""
|
|
2548
|
+
|
|
2549
|
+
kind = "EXPRESSION_OS_PATH_NORMPATH_REF"
|
|
2550
|
+
|
|
2551
|
+
def __init__(self, source_ref):
|
|
2552
|
+
ExpressionImportModuleNameHardExistsSpecificBase.__init__(
|
|
2553
|
+
self,
|
|
2554
|
+
module_name=os.path.__name__,
|
|
2555
|
+
import_name="normpath",
|
|
2556
|
+
module_guaranteed=True,
|
|
2557
|
+
source_ref=source_ref,
|
|
2558
|
+
)
|
|
2559
|
+
|
|
2560
|
+
def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):
|
|
2561
|
+
# Anything may happen on call trace before this. On next pass, if
|
|
2562
|
+
# replaced, we might be better but not now.
|
|
2563
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
2564
|
+
|
|
2565
|
+
from .OsSysNodes import ExpressionOsPathNormpathCall
|
|
2566
|
+
|
|
2567
|
+
result = extractBuiltinArgs(
|
|
2568
|
+
node=call_node,
|
|
2569
|
+
builtin_class=ExpressionOsPathNormpathCall,
|
|
2570
|
+
builtin_spec=os_path_normpath_spec,
|
|
2571
|
+
)
|
|
2572
|
+
|
|
2573
|
+
return (
|
|
2574
|
+
result,
|
|
2575
|
+
"new_expression",
|
|
2576
|
+
"Call to 'os.path.normpath' recognized.",
|
|
2577
|
+
)
|
|
2578
|
+
|
|
2579
|
+
|
|
2580
|
+
hard_import_node_classes[ExpressionOsPathNormpathRef] = os_path_normpath_spec
|
|
2581
|
+
|
|
2582
|
+
|
|
2583
|
+
class ExpressionOsPathNormpathCallBase(ChildHavingPathMixin, ExpressionBase):
|
|
2584
|
+
"""Base class for OsPathNormpathCall
|
|
2585
|
+
|
|
2586
|
+
Generated boiler plate code from 'HardImportCallNode.py.j2' template.
|
|
2587
|
+
"""
|
|
2588
|
+
|
|
2589
|
+
named_children = ("path",)
|
|
2590
|
+
|
|
2591
|
+
__slots__ = ("attempted",)
|
|
2592
|
+
|
|
2593
|
+
spec = os_path_normpath_spec
|
|
2594
|
+
|
|
2595
|
+
def __init__(self, path, source_ref):
|
|
2596
|
+
|
|
2597
|
+
ChildHavingPathMixin.__init__(
|
|
2598
|
+
self,
|
|
2599
|
+
path=path,
|
|
2600
|
+
)
|
|
2601
|
+
|
|
2602
|
+
ExpressionBase.__init__(self, source_ref)
|
|
2603
|
+
|
|
2604
|
+
self.attempted = False
|
|
2605
|
+
|
|
2606
|
+
def computeExpression(self, trace_collection):
|
|
2607
|
+
if self.attempted or not os_path_normpath_spec.isCompileTimeComputable(
|
|
2608
|
+
(self.subnode_path,)
|
|
2609
|
+
):
|
|
2610
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
2611
|
+
|
|
2612
|
+
return self, None, None
|
|
2613
|
+
|
|
2614
|
+
try:
|
|
2615
|
+
return self.replaceWithCompileTimeValue(trace_collection)
|
|
2616
|
+
finally:
|
|
2617
|
+
self.attempted = True
|
|
2618
|
+
|
|
2619
|
+
@abstractmethod
|
|
2620
|
+
def replaceWithCompileTimeValue(self, trace_collection):
|
|
2621
|
+
pass
|
|
2622
|
+
|
|
2623
|
+
@staticmethod
|
|
2624
|
+
def mayRaiseExceptionOperation():
|
|
2625
|
+
return True
|
|
2626
|
+
|
|
2627
|
+
|
|
2628
|
+
class ExpressionOsStatRef(ExpressionImportModuleNameHardExistsSpecificBase):
|
|
2629
|
+
"""Function reference os.stat"""
|
|
2630
|
+
|
|
2631
|
+
kind = "EXPRESSION_OS_STAT_REF"
|
|
2632
|
+
|
|
2633
|
+
def __init__(self, source_ref):
|
|
2634
|
+
ExpressionImportModuleNameHardExistsSpecificBase.__init__(
|
|
2635
|
+
self,
|
|
2636
|
+
module_name="os",
|
|
2637
|
+
import_name="stat",
|
|
2638
|
+
module_guaranteed=True,
|
|
2639
|
+
source_ref=source_ref,
|
|
2640
|
+
)
|
|
2641
|
+
|
|
2642
|
+
def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):
|
|
2643
|
+
# Anything may happen on call trace before this. On next pass, if
|
|
2644
|
+
# replaced, we might be better but not now.
|
|
2645
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
2646
|
+
|
|
2647
|
+
from .OsSysNodes import ExpressionOsStatCall
|
|
2648
|
+
|
|
2649
|
+
result = extractBuiltinArgs(
|
|
2650
|
+
node=call_node,
|
|
2651
|
+
builtin_class=ExpressionOsStatCall,
|
|
2652
|
+
builtin_spec=os_stat_spec,
|
|
2653
|
+
)
|
|
2654
|
+
|
|
2655
|
+
return (
|
|
2656
|
+
result,
|
|
2657
|
+
"new_expression",
|
|
2658
|
+
"Call to 'os.stat' recognized.",
|
|
2659
|
+
)
|
|
2660
|
+
|
|
2661
|
+
|
|
2662
|
+
hard_import_node_classes[ExpressionOsStatRef] = os_stat_spec
|
|
2663
|
+
|
|
2664
|
+
|
|
2665
|
+
class ExpressionOsStatCallBase(
|
|
2666
|
+
ChildrenHavingPathOptionalDirFdOptionalFollowSymlinksOptionalMixin, ExpressionBase
|
|
2667
|
+
):
|
|
2668
|
+
"""Base class for OsStatCall
|
|
2669
|
+
|
|
2670
|
+
Generated boiler plate code from 'HardImportCallNode.py.j2' template.
|
|
2671
|
+
"""
|
|
2672
|
+
|
|
2673
|
+
named_children = (
|
|
2674
|
+
"path|optional",
|
|
2675
|
+
"dir_fd|optional",
|
|
2676
|
+
"follow_symlinks|optional",
|
|
2677
|
+
)
|
|
2678
|
+
|
|
2679
|
+
__slots__ = ("attempted",)
|
|
2680
|
+
|
|
2681
|
+
spec = os_stat_spec
|
|
2682
|
+
|
|
2683
|
+
def __init__(self, path, dir_fd, follow_symlinks, source_ref):
|
|
2684
|
+
|
|
2685
|
+
ChildrenHavingPathOptionalDirFdOptionalFollowSymlinksOptionalMixin.__init__(
|
|
2686
|
+
self,
|
|
2687
|
+
path=path,
|
|
2688
|
+
dir_fd=dir_fd,
|
|
2689
|
+
follow_symlinks=follow_symlinks,
|
|
2690
|
+
)
|
|
2691
|
+
|
|
2692
|
+
ExpressionBase.__init__(self, source_ref)
|
|
2693
|
+
|
|
2694
|
+
self.attempted = False
|
|
2695
|
+
|
|
2696
|
+
def computeExpression(self, trace_collection):
|
|
2697
|
+
if self.attempted or not os_stat_spec.isCompileTimeComputable(
|
|
2698
|
+
(self.subnode_path,)
|
|
2699
|
+
):
|
|
2700
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
2701
|
+
|
|
2702
|
+
return self, None, None
|
|
2703
|
+
|
|
2704
|
+
try:
|
|
2705
|
+
return self.replaceWithCompileTimeValue(trace_collection)
|
|
2706
|
+
finally:
|
|
2707
|
+
self.attempted = True
|
|
2708
|
+
|
|
2709
|
+
@abstractmethod
|
|
2710
|
+
def replaceWithCompileTimeValue(self, trace_collection):
|
|
2711
|
+
pass
|
|
2712
|
+
|
|
2713
|
+
@staticmethod
|
|
2714
|
+
def mayRaiseExceptionOperation():
|
|
2715
|
+
return True
|
|
2716
|
+
|
|
2717
|
+
|
|
2718
|
+
class ExpressionOsUnameRef(ExpressionImportModuleNameHardExistsSpecificBase):
|
|
2719
|
+
"""Function reference os.uname"""
|
|
2720
|
+
|
|
2721
|
+
kind = "EXPRESSION_OS_UNAME_REF"
|
|
2722
|
+
|
|
2723
|
+
def __init__(self, source_ref):
|
|
2724
|
+
ExpressionImportModuleNameHardExistsSpecificBase.__init__(
|
|
2725
|
+
self,
|
|
2726
|
+
module_name="os",
|
|
2727
|
+
import_name="uname",
|
|
2728
|
+
module_guaranteed=True,
|
|
2729
|
+
source_ref=source_ref,
|
|
2730
|
+
)
|
|
2731
|
+
|
|
2732
|
+
def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):
|
|
2733
|
+
# Anything may happen on call trace before this. On next pass, if
|
|
2734
|
+
# replaced, we might be better but not now.
|
|
2735
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
2736
|
+
|
|
2737
|
+
from .OsSysNodes import ExpressionOsUnameCall
|
|
2738
|
+
|
|
2739
|
+
result = extractBuiltinArgs(
|
|
2740
|
+
node=call_node,
|
|
2741
|
+
builtin_class=ExpressionOsUnameCall,
|
|
2742
|
+
builtin_spec=os_uname_spec,
|
|
2743
|
+
)
|
|
2744
|
+
|
|
2745
|
+
return (
|
|
2746
|
+
result,
|
|
2747
|
+
"new_expression",
|
|
2748
|
+
"Call to 'os.uname' recognized.",
|
|
2749
|
+
)
|
|
2750
|
+
|
|
2751
|
+
|
|
2752
|
+
hard_import_node_classes[ExpressionOsUnameRef] = os_uname_spec
|
|
2753
|
+
|
|
2754
|
+
|
|
2755
|
+
class ExpressionOsUnameCallBase(ExpressionBase):
|
|
2756
|
+
"""Base class for OsUnameCall
|
|
2757
|
+
|
|
2758
|
+
Generated boiler plate code from 'HardImportCallNode.py.j2' template.
|
|
2759
|
+
"""
|
|
2760
|
+
|
|
2761
|
+
__slots__ = ("attempted",)
|
|
2762
|
+
|
|
2763
|
+
spec = os_uname_spec
|
|
2764
|
+
|
|
2765
|
+
def __init__(self, source_ref):
|
|
2766
|
+
|
|
2767
|
+
ExpressionBase.__init__(self, source_ref)
|
|
2768
|
+
|
|
2769
|
+
self.attempted = False
|
|
2770
|
+
|
|
2771
|
+
def finalize(self):
|
|
2772
|
+
del self.parent
|
|
2773
|
+
|
|
2774
|
+
def computeExpressionRaw(self, trace_collection):
|
|
2775
|
+
if self.attempted:
|
|
2776
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
2777
|
+
|
|
2778
|
+
return self, None, None
|
|
2779
|
+
|
|
2780
|
+
try:
|
|
2781
|
+
return self.replaceWithCompileTimeValue(trace_collection)
|
|
2782
|
+
finally:
|
|
2783
|
+
self.attempted = True
|
|
2784
|
+
|
|
2785
|
+
@abstractmethod
|
|
2786
|
+
def replaceWithCompileTimeValue(self, trace_collection):
|
|
2787
|
+
pass
|
|
2788
|
+
|
|
2789
|
+
@staticmethod
|
|
2790
|
+
def mayRaiseExceptionOperation():
|
|
2791
|
+
return True
|
|
2792
|
+
|
|
2793
|
+
|
|
2794
|
+
class ExpressionPkgResourcesGetDistributionRef(
|
|
2795
|
+
ExpressionImportModuleNameHardExistsSpecificBase
|
|
2796
|
+
):
|
|
2797
|
+
"""Function reference pkg_resources.get_distribution"""
|
|
2798
|
+
|
|
2799
|
+
kind = "EXPRESSION_PKG_RESOURCES_GET_DISTRIBUTION_REF"
|
|
2800
|
+
|
|
2801
|
+
def __init__(self, source_ref):
|
|
2802
|
+
ExpressionImportModuleNameHardExistsSpecificBase.__init__(
|
|
2803
|
+
self,
|
|
2804
|
+
module_name="pkg_resources",
|
|
2805
|
+
import_name="get_distribution",
|
|
2806
|
+
module_guaranteed=not shallMakeModule(),
|
|
2807
|
+
source_ref=source_ref,
|
|
2808
|
+
)
|
|
2809
|
+
|
|
2810
|
+
def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):
|
|
2811
|
+
# Anything may happen on call trace before this. On next pass, if
|
|
2812
|
+
# replaced, we might be better but not now.
|
|
2813
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
2814
|
+
|
|
2815
|
+
from .PackageMetadataNodes import (
|
|
2816
|
+
ExpressionPkgResourcesGetDistributionCall,
|
|
2817
|
+
)
|
|
2818
|
+
|
|
2819
|
+
result = extractBuiltinArgs(
|
|
2820
|
+
node=call_node,
|
|
2821
|
+
builtin_class=ExpressionPkgResourcesGetDistributionCall,
|
|
2822
|
+
builtin_spec=pkg_resources_get_distribution_spec,
|
|
2823
|
+
)
|
|
2824
|
+
|
|
2825
|
+
return (
|
|
2826
|
+
result,
|
|
2827
|
+
"new_expression",
|
|
2828
|
+
"Call to 'pkg_resources.get_distribution' recognized.",
|
|
2829
|
+
)
|
|
2830
|
+
|
|
2831
|
+
|
|
2832
|
+
hard_import_node_classes[ExpressionPkgResourcesGetDistributionRef] = (
|
|
2833
|
+
pkg_resources_get_distribution_spec
|
|
2834
|
+
)
|
|
2835
|
+
|
|
2836
|
+
|
|
2837
|
+
class ExpressionPkgResourcesGetDistributionCallBase(
|
|
2838
|
+
ChildHavingDistMixin, ExpressionBase
|
|
2839
|
+
):
|
|
2840
|
+
"""Base class for PkgResourcesGetDistributionCall
|
|
2841
|
+
|
|
2842
|
+
Generated boiler plate code from 'HardImportCallNode.py.j2' template.
|
|
2843
|
+
"""
|
|
2844
|
+
|
|
2845
|
+
named_children = ("dist",)
|
|
2846
|
+
|
|
2847
|
+
__slots__ = ("attempted",)
|
|
2848
|
+
|
|
2849
|
+
spec = pkg_resources_get_distribution_spec
|
|
2850
|
+
|
|
2851
|
+
def __init__(self, dist, source_ref):
|
|
2852
|
+
|
|
2853
|
+
ChildHavingDistMixin.__init__(
|
|
2854
|
+
self,
|
|
2855
|
+
dist=dist,
|
|
2856
|
+
)
|
|
2857
|
+
|
|
2858
|
+
ExpressionBase.__init__(self, source_ref)
|
|
2859
|
+
|
|
2860
|
+
# In module mode, we expect a changing environment, cannot optimize this
|
|
2861
|
+
self.attempted = shallMakeModule()
|
|
2862
|
+
|
|
2863
|
+
def computeExpression(self, trace_collection):
|
|
2864
|
+
if (
|
|
2865
|
+
self.attempted
|
|
2866
|
+
or not pkg_resources_get_distribution_spec.isCompileTimeComputable(
|
|
2867
|
+
(self.subnode_dist,)
|
|
2868
|
+
)
|
|
2869
|
+
):
|
|
2870
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
2871
|
+
|
|
2872
|
+
return self, None, None
|
|
2873
|
+
|
|
2874
|
+
try:
|
|
2875
|
+
return self.replaceWithCompileTimeValue(trace_collection)
|
|
2876
|
+
finally:
|
|
2877
|
+
self.attempted = True
|
|
2878
|
+
|
|
2879
|
+
@abstractmethod
|
|
2880
|
+
def replaceWithCompileTimeValue(self, trace_collection):
|
|
2881
|
+
pass
|
|
2882
|
+
|
|
2883
|
+
@staticmethod
|
|
2884
|
+
def mayRaiseExceptionOperation():
|
|
2885
|
+
return True
|
|
2886
|
+
|
|
2887
|
+
|
|
2888
|
+
class ExpressionPkgResourcesIterEntryPointsRef(
|
|
2889
|
+
ExpressionImportModuleNameHardExistsSpecificBase
|
|
2890
|
+
):
|
|
2891
|
+
"""Function reference pkg_resources.iter_entry_points"""
|
|
2892
|
+
|
|
2893
|
+
kind = "EXPRESSION_PKG_RESOURCES_ITER_ENTRY_POINTS_REF"
|
|
2894
|
+
|
|
2895
|
+
def __init__(self, source_ref):
|
|
2896
|
+
ExpressionImportModuleNameHardExistsSpecificBase.__init__(
|
|
2897
|
+
self,
|
|
2898
|
+
module_name="pkg_resources",
|
|
2899
|
+
import_name="iter_entry_points",
|
|
2900
|
+
module_guaranteed=not shallMakeModule(),
|
|
2901
|
+
source_ref=source_ref,
|
|
2902
|
+
)
|
|
2903
|
+
|
|
2904
|
+
def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):
|
|
2905
|
+
# Anything may happen on call trace before this. On next pass, if
|
|
2906
|
+
# replaced, we might be better but not now.
|
|
2907
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
2908
|
+
|
|
2909
|
+
from .PackageMetadataNodes import (
|
|
2910
|
+
ExpressionPkgResourcesIterEntryPointsCall,
|
|
2911
|
+
)
|
|
2912
|
+
|
|
2913
|
+
result = extractBuiltinArgs(
|
|
2914
|
+
node=call_node,
|
|
2915
|
+
builtin_class=ExpressionPkgResourcesIterEntryPointsCall,
|
|
2916
|
+
builtin_spec=pkg_resources_iter_entry_points_spec,
|
|
2917
|
+
)
|
|
2918
|
+
|
|
2919
|
+
return (
|
|
2920
|
+
result,
|
|
2921
|
+
"new_expression",
|
|
2922
|
+
"Call to 'pkg_resources.iter_entry_points' recognized.",
|
|
2923
|
+
)
|
|
2924
|
+
|
|
2925
|
+
|
|
2926
|
+
hard_import_node_classes[ExpressionPkgResourcesIterEntryPointsRef] = (
|
|
2927
|
+
pkg_resources_iter_entry_points_spec
|
|
2928
|
+
)
|
|
2929
|
+
|
|
2930
|
+
|
|
2931
|
+
class ExpressionPkgResourcesIterEntryPointsCallBase(
|
|
2932
|
+
ChildrenHavingGroupNameOptionalMixin, ExpressionBase
|
|
2933
|
+
):
|
|
2934
|
+
"""Base class for PkgResourcesIterEntryPointsCall
|
|
2935
|
+
|
|
2936
|
+
Generated boiler plate code from 'HardImportCallNode.py.j2' template.
|
|
2937
|
+
"""
|
|
2938
|
+
|
|
2939
|
+
named_children = (
|
|
2940
|
+
"group",
|
|
2941
|
+
"name|optional",
|
|
2942
|
+
)
|
|
2943
|
+
|
|
2944
|
+
__slots__ = ("attempted",)
|
|
2945
|
+
|
|
2946
|
+
spec = pkg_resources_iter_entry_points_spec
|
|
2947
|
+
|
|
2948
|
+
def __init__(self, group, name, source_ref):
|
|
2949
|
+
|
|
2950
|
+
ChildrenHavingGroupNameOptionalMixin.__init__(
|
|
2951
|
+
self,
|
|
2952
|
+
group=group,
|
|
2953
|
+
name=name,
|
|
2954
|
+
)
|
|
2955
|
+
|
|
2956
|
+
ExpressionBase.__init__(self, source_ref)
|
|
2957
|
+
|
|
2958
|
+
# In module mode, we expect a changing environment, cannot optimize this
|
|
2959
|
+
self.attempted = shallMakeModule()
|
|
2960
|
+
|
|
2961
|
+
def computeExpression(self, trace_collection):
|
|
2962
|
+
if (
|
|
2963
|
+
self.attempted
|
|
2964
|
+
or not pkg_resources_iter_entry_points_spec.isCompileTimeComputable(
|
|
2965
|
+
(
|
|
2966
|
+
self.subnode_group,
|
|
2967
|
+
self.subnode_name,
|
|
2968
|
+
)
|
|
2969
|
+
)
|
|
2970
|
+
):
|
|
2971
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
2972
|
+
|
|
2973
|
+
return self, None, None
|
|
2974
|
+
|
|
2975
|
+
try:
|
|
2976
|
+
return self.replaceWithCompileTimeValue(trace_collection)
|
|
2977
|
+
finally:
|
|
2978
|
+
self.attempted = True
|
|
2979
|
+
|
|
2980
|
+
@abstractmethod
|
|
2981
|
+
def replaceWithCompileTimeValue(self, trace_collection):
|
|
2982
|
+
pass
|
|
2983
|
+
|
|
2984
|
+
@staticmethod
|
|
2985
|
+
def mayRaiseExceptionOperation():
|
|
2986
|
+
return True
|
|
2987
|
+
|
|
2988
|
+
|
|
2989
|
+
class ExpressionPkgResourcesRequireRef(
|
|
2990
|
+
ExpressionImportModuleNameHardExistsSpecificBase
|
|
2991
|
+
):
|
|
2992
|
+
"""Function reference pkg_resources.require"""
|
|
2993
|
+
|
|
2994
|
+
kind = "EXPRESSION_PKG_RESOURCES_REQUIRE_REF"
|
|
2995
|
+
|
|
2996
|
+
def __init__(self, source_ref):
|
|
2997
|
+
ExpressionImportModuleNameHardExistsSpecificBase.__init__(
|
|
2998
|
+
self,
|
|
2999
|
+
module_name="pkg_resources",
|
|
3000
|
+
import_name="require",
|
|
3001
|
+
module_guaranteed=not shallMakeModule(),
|
|
3002
|
+
source_ref=source_ref,
|
|
3003
|
+
)
|
|
3004
|
+
|
|
3005
|
+
def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):
|
|
3006
|
+
# Anything may happen on call trace before this. On next pass, if
|
|
3007
|
+
# replaced, we might be better but not now.
|
|
3008
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
3009
|
+
|
|
3010
|
+
from .PackageMetadataNodes import ExpressionPkgResourcesRequireCall
|
|
3011
|
+
|
|
3012
|
+
result = extractBuiltinArgs(
|
|
3013
|
+
node=call_node,
|
|
3014
|
+
builtin_class=ExpressionPkgResourcesRequireCall,
|
|
3015
|
+
builtin_spec=pkg_resources_require_spec,
|
|
3016
|
+
)
|
|
3017
|
+
|
|
3018
|
+
return (
|
|
3019
|
+
result,
|
|
3020
|
+
"new_expression",
|
|
3021
|
+
"Call to 'pkg_resources.require' recognized.",
|
|
3022
|
+
)
|
|
3023
|
+
|
|
3024
|
+
|
|
3025
|
+
hard_import_node_classes[ExpressionPkgResourcesRequireRef] = pkg_resources_require_spec
|
|
3026
|
+
|
|
3027
|
+
|
|
3028
|
+
class ExpressionPkgResourcesRequireCallBase(
|
|
3029
|
+
ChildHavingRequirementsTupleMixin, ExpressionBase
|
|
3030
|
+
):
|
|
3031
|
+
"""Base class for PkgResourcesRequireCall
|
|
3032
|
+
|
|
3033
|
+
Generated boiler plate code from 'HardImportCallNode.py.j2' template.
|
|
3034
|
+
"""
|
|
3035
|
+
|
|
3036
|
+
named_children = ("requirements|tuple",)
|
|
3037
|
+
|
|
3038
|
+
__slots__ = ("attempted",)
|
|
3039
|
+
|
|
3040
|
+
spec = pkg_resources_require_spec
|
|
3041
|
+
|
|
3042
|
+
def __init__(self, requirements, source_ref):
|
|
3043
|
+
|
|
3044
|
+
ChildHavingRequirementsTupleMixin.__init__(
|
|
3045
|
+
self,
|
|
3046
|
+
requirements=requirements,
|
|
3047
|
+
)
|
|
3048
|
+
|
|
3049
|
+
ExpressionBase.__init__(self, source_ref)
|
|
3050
|
+
|
|
3051
|
+
# In module mode, we expect a changing environment, cannot optimize this
|
|
3052
|
+
self.attempted = shallMakeModule()
|
|
3053
|
+
|
|
3054
|
+
def computeExpression(self, trace_collection):
|
|
3055
|
+
if self.attempted or not pkg_resources_require_spec.isCompileTimeComputable(
|
|
3056
|
+
() + self.subnode_requirements
|
|
3057
|
+
):
|
|
3058
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
3059
|
+
|
|
3060
|
+
return self, None, None
|
|
3061
|
+
|
|
3062
|
+
try:
|
|
3063
|
+
return self.replaceWithCompileTimeValue(trace_collection)
|
|
3064
|
+
finally:
|
|
3065
|
+
self.attempted = True
|
|
3066
|
+
|
|
3067
|
+
@abstractmethod
|
|
3068
|
+
def replaceWithCompileTimeValue(self, trace_collection):
|
|
3069
|
+
pass
|
|
3070
|
+
|
|
3071
|
+
@staticmethod
|
|
3072
|
+
def mayRaiseExceptionOperation():
|
|
3073
|
+
return True
|
|
3074
|
+
|
|
3075
|
+
|
|
3076
|
+
class ExpressionPkgResourcesResourceStreamRef(
|
|
3077
|
+
ExpressionImportModuleNameHardExistsSpecificBase
|
|
3078
|
+
):
|
|
3079
|
+
"""Function reference pkg_resources.resource_stream"""
|
|
3080
|
+
|
|
3081
|
+
kind = "EXPRESSION_PKG_RESOURCES_RESOURCE_STREAM_REF"
|
|
3082
|
+
|
|
3083
|
+
def __init__(self, source_ref):
|
|
3084
|
+
ExpressionImportModuleNameHardExistsSpecificBase.__init__(
|
|
3085
|
+
self,
|
|
3086
|
+
module_name="pkg_resources",
|
|
3087
|
+
import_name="resource_stream",
|
|
3088
|
+
module_guaranteed=not shallMakeModule(),
|
|
3089
|
+
source_ref=source_ref,
|
|
3090
|
+
)
|
|
3091
|
+
|
|
3092
|
+
def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):
|
|
3093
|
+
# Anything may happen on call trace before this. On next pass, if
|
|
3094
|
+
# replaced, we might be better but not now.
|
|
3095
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
3096
|
+
|
|
3097
|
+
from .PackageResourceNodes import (
|
|
3098
|
+
ExpressionPkgResourcesResourceStreamCall,
|
|
3099
|
+
)
|
|
3100
|
+
|
|
3101
|
+
result = extractBuiltinArgs(
|
|
3102
|
+
node=call_node,
|
|
3103
|
+
builtin_class=ExpressionPkgResourcesResourceStreamCall,
|
|
3104
|
+
builtin_spec=pkg_resources_resource_stream_spec,
|
|
3105
|
+
)
|
|
3106
|
+
|
|
3107
|
+
return (
|
|
3108
|
+
result,
|
|
3109
|
+
"new_expression",
|
|
3110
|
+
"Call to 'pkg_resources.resource_stream' recognized.",
|
|
3111
|
+
)
|
|
3112
|
+
|
|
3113
|
+
|
|
3114
|
+
hard_import_node_classes[ExpressionPkgResourcesResourceStreamRef] = (
|
|
3115
|
+
pkg_resources_resource_stream_spec
|
|
3116
|
+
)
|
|
3117
|
+
|
|
3118
|
+
|
|
3119
|
+
class ExpressionPkgResourcesResourceStreamCallBase(
|
|
3120
|
+
ChildrenHavingPackageOrRequirementResourceNameMixin, ExpressionBase
|
|
3121
|
+
):
|
|
3122
|
+
"""Base class for PkgResourcesResourceStreamCall
|
|
3123
|
+
|
|
3124
|
+
Generated boiler plate code from 'HardImportCallNode.py.j2' template.
|
|
3125
|
+
"""
|
|
3126
|
+
|
|
3127
|
+
named_children = (
|
|
3128
|
+
"package_or_requirement",
|
|
3129
|
+
"resource_name",
|
|
3130
|
+
)
|
|
3131
|
+
|
|
3132
|
+
__slots__ = ("attempted",)
|
|
3133
|
+
|
|
3134
|
+
spec = pkg_resources_resource_stream_spec
|
|
3135
|
+
|
|
3136
|
+
def __init__(self, package_or_requirement, resource_name, source_ref):
|
|
3137
|
+
|
|
3138
|
+
ChildrenHavingPackageOrRequirementResourceNameMixin.__init__(
|
|
3139
|
+
self,
|
|
3140
|
+
package_or_requirement=package_or_requirement,
|
|
3141
|
+
resource_name=resource_name,
|
|
3142
|
+
)
|
|
3143
|
+
|
|
3144
|
+
ExpressionBase.__init__(self, source_ref)
|
|
3145
|
+
|
|
3146
|
+
# In module mode, we expect a changing environment, cannot optimize this
|
|
3147
|
+
self.attempted = shallMakeModule()
|
|
3148
|
+
|
|
3149
|
+
def computeExpression(self, trace_collection):
|
|
3150
|
+
if (
|
|
3151
|
+
self.attempted
|
|
3152
|
+
or not pkg_resources_resource_stream_spec.isCompileTimeComputable(
|
|
3153
|
+
(
|
|
3154
|
+
self.subnode_package_or_requirement,
|
|
3155
|
+
self.subnode_resource_name,
|
|
3156
|
+
)
|
|
3157
|
+
)
|
|
3158
|
+
):
|
|
3159
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
3160
|
+
|
|
3161
|
+
return self, None, None
|
|
3162
|
+
|
|
3163
|
+
try:
|
|
3164
|
+
return self.replaceWithCompileTimeValue(trace_collection)
|
|
3165
|
+
finally:
|
|
3166
|
+
self.attempted = True
|
|
3167
|
+
|
|
3168
|
+
@abstractmethod
|
|
3169
|
+
def replaceWithCompileTimeValue(self, trace_collection):
|
|
3170
|
+
pass
|
|
3171
|
+
|
|
3172
|
+
@staticmethod
|
|
3173
|
+
def mayRaiseExceptionOperation():
|
|
3174
|
+
return True
|
|
3175
|
+
|
|
3176
|
+
|
|
3177
|
+
class ExpressionPkgResourcesResourceStringRef(
|
|
3178
|
+
ExpressionImportModuleNameHardExistsSpecificBase
|
|
3179
|
+
):
|
|
3180
|
+
"""Function reference pkg_resources.resource_string"""
|
|
3181
|
+
|
|
3182
|
+
kind = "EXPRESSION_PKG_RESOURCES_RESOURCE_STRING_REF"
|
|
3183
|
+
|
|
3184
|
+
def __init__(self, source_ref):
|
|
3185
|
+
ExpressionImportModuleNameHardExistsSpecificBase.__init__(
|
|
3186
|
+
self,
|
|
3187
|
+
module_name="pkg_resources",
|
|
3188
|
+
import_name="resource_string",
|
|
3189
|
+
module_guaranteed=not shallMakeModule(),
|
|
3190
|
+
source_ref=source_ref,
|
|
3191
|
+
)
|
|
3192
|
+
|
|
3193
|
+
def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):
|
|
3194
|
+
# Anything may happen on call trace before this. On next pass, if
|
|
3195
|
+
# replaced, we might be better but not now.
|
|
3196
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
3197
|
+
|
|
3198
|
+
from .PackageResourceNodes import (
|
|
3199
|
+
ExpressionPkgResourcesResourceStringCall,
|
|
3200
|
+
)
|
|
3201
|
+
|
|
3202
|
+
result = extractBuiltinArgs(
|
|
3203
|
+
node=call_node,
|
|
3204
|
+
builtin_class=ExpressionPkgResourcesResourceStringCall,
|
|
3205
|
+
builtin_spec=pkg_resources_resource_string_spec,
|
|
3206
|
+
)
|
|
3207
|
+
|
|
3208
|
+
return (
|
|
3209
|
+
result,
|
|
3210
|
+
"new_expression",
|
|
3211
|
+
"Call to 'pkg_resources.resource_string' recognized.",
|
|
3212
|
+
)
|
|
3213
|
+
|
|
3214
|
+
|
|
3215
|
+
hard_import_node_classes[ExpressionPkgResourcesResourceStringRef] = (
|
|
3216
|
+
pkg_resources_resource_string_spec
|
|
3217
|
+
)
|
|
3218
|
+
|
|
3219
|
+
|
|
3220
|
+
class ExpressionPkgResourcesResourceStringCallBase(
|
|
3221
|
+
ChildrenHavingPackageOrRequirementResourceNameMixin, ExpressionBase
|
|
3222
|
+
):
|
|
3223
|
+
"""Base class for PkgResourcesResourceStringCall
|
|
3224
|
+
|
|
3225
|
+
Generated boiler plate code from 'HardImportCallNode.py.j2' template.
|
|
3226
|
+
"""
|
|
3227
|
+
|
|
3228
|
+
named_children = (
|
|
3229
|
+
"package_or_requirement",
|
|
3230
|
+
"resource_name",
|
|
3231
|
+
)
|
|
3232
|
+
|
|
3233
|
+
__slots__ = ("attempted",)
|
|
3234
|
+
|
|
3235
|
+
spec = pkg_resources_resource_string_spec
|
|
3236
|
+
|
|
3237
|
+
def __init__(self, package_or_requirement, resource_name, source_ref):
|
|
3238
|
+
|
|
3239
|
+
ChildrenHavingPackageOrRequirementResourceNameMixin.__init__(
|
|
3240
|
+
self,
|
|
3241
|
+
package_or_requirement=package_or_requirement,
|
|
3242
|
+
resource_name=resource_name,
|
|
3243
|
+
)
|
|
3244
|
+
|
|
3245
|
+
ExpressionBase.__init__(self, source_ref)
|
|
3246
|
+
|
|
3247
|
+
# In module mode, we expect a changing environment, cannot optimize this
|
|
3248
|
+
self.attempted = shallMakeModule()
|
|
3249
|
+
|
|
3250
|
+
def computeExpression(self, trace_collection):
|
|
3251
|
+
if (
|
|
3252
|
+
self.attempted
|
|
3253
|
+
or not pkg_resources_resource_string_spec.isCompileTimeComputable(
|
|
3254
|
+
(
|
|
3255
|
+
self.subnode_package_or_requirement,
|
|
3256
|
+
self.subnode_resource_name,
|
|
3257
|
+
)
|
|
3258
|
+
)
|
|
3259
|
+
):
|
|
3260
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
3261
|
+
|
|
3262
|
+
return self, None, None
|
|
3263
|
+
|
|
3264
|
+
try:
|
|
3265
|
+
return self.replaceWithCompileTimeValue(trace_collection)
|
|
3266
|
+
finally:
|
|
3267
|
+
self.attempted = True
|
|
3268
|
+
|
|
3269
|
+
@abstractmethod
|
|
3270
|
+
def replaceWithCompileTimeValue(self, trace_collection):
|
|
3271
|
+
pass
|
|
3272
|
+
|
|
3273
|
+
@staticmethod
|
|
3274
|
+
def mayRaiseExceptionOperation():
|
|
3275
|
+
return True
|
|
3276
|
+
|
|
3277
|
+
|
|
3278
|
+
class ExpressionPkgutilGetDataRef(ExpressionImportModuleNameHardExistsSpecificBase):
|
|
3279
|
+
"""Function reference pkgutil.get_data"""
|
|
3280
|
+
|
|
3281
|
+
kind = "EXPRESSION_PKGUTIL_GET_DATA_REF"
|
|
3282
|
+
|
|
3283
|
+
def __init__(self, source_ref):
|
|
3284
|
+
ExpressionImportModuleNameHardExistsSpecificBase.__init__(
|
|
3285
|
+
self,
|
|
3286
|
+
module_name="pkgutil",
|
|
3287
|
+
import_name="get_data",
|
|
3288
|
+
module_guaranteed=True,
|
|
3289
|
+
source_ref=source_ref,
|
|
3290
|
+
)
|
|
3291
|
+
|
|
3292
|
+
def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):
|
|
3293
|
+
# Anything may happen on call trace before this. On next pass, if
|
|
3294
|
+
# replaced, we might be better but not now.
|
|
3295
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
3296
|
+
|
|
3297
|
+
from .PackageResourceNodes import ExpressionPkgutilGetDataCall
|
|
3298
|
+
|
|
3299
|
+
result = extractBuiltinArgs(
|
|
3300
|
+
node=call_node,
|
|
3301
|
+
builtin_class=ExpressionPkgutilGetDataCall,
|
|
3302
|
+
builtin_spec=pkgutil_get_data_spec,
|
|
3303
|
+
)
|
|
3304
|
+
|
|
3305
|
+
return (
|
|
3306
|
+
result,
|
|
3307
|
+
"new_expression",
|
|
3308
|
+
"Call to 'pkgutil.get_data' recognized.",
|
|
3309
|
+
)
|
|
3310
|
+
|
|
3311
|
+
|
|
3312
|
+
hard_import_node_classes[ExpressionPkgutilGetDataRef] = pkgutil_get_data_spec
|
|
3313
|
+
|
|
3314
|
+
|
|
3315
|
+
class ExpressionPkgutilGetDataCallBase(
|
|
3316
|
+
ChildrenHavingPackageResourceMixin, ExpressionBase
|
|
3317
|
+
):
|
|
3318
|
+
"""Base class for PkgutilGetDataCall
|
|
3319
|
+
|
|
3320
|
+
Generated boiler plate code from 'HardImportCallNode.py.j2' template.
|
|
3321
|
+
"""
|
|
3322
|
+
|
|
3323
|
+
named_children = (
|
|
3324
|
+
"package",
|
|
3325
|
+
"resource",
|
|
3326
|
+
)
|
|
3327
|
+
|
|
3328
|
+
__slots__ = ("attempted",)
|
|
3329
|
+
|
|
3330
|
+
spec = pkgutil_get_data_spec
|
|
3331
|
+
|
|
3332
|
+
def __init__(self, package, resource, source_ref):
|
|
3333
|
+
|
|
3334
|
+
ChildrenHavingPackageResourceMixin.__init__(
|
|
3335
|
+
self,
|
|
3336
|
+
package=package,
|
|
3337
|
+
resource=resource,
|
|
3338
|
+
)
|
|
3339
|
+
|
|
3340
|
+
ExpressionBase.__init__(self, source_ref)
|
|
3341
|
+
|
|
3342
|
+
self.attempted = False
|
|
3343
|
+
|
|
3344
|
+
def computeExpression(self, trace_collection):
|
|
3345
|
+
if self.attempted or not pkgutil_get_data_spec.isCompileTimeComputable(
|
|
3346
|
+
(
|
|
3347
|
+
self.subnode_package,
|
|
3348
|
+
self.subnode_resource,
|
|
3349
|
+
)
|
|
3350
|
+
):
|
|
3351
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
3352
|
+
|
|
3353
|
+
return self, None, None
|
|
3354
|
+
|
|
3355
|
+
try:
|
|
3356
|
+
return self.replaceWithCompileTimeValue(trace_collection)
|
|
3357
|
+
finally:
|
|
3358
|
+
self.attempted = True
|
|
3359
|
+
|
|
3360
|
+
@abstractmethod
|
|
3361
|
+
def replaceWithCompileTimeValue(self, trace_collection):
|
|
3362
|
+
pass
|
|
3363
|
+
|
|
3364
|
+
@staticmethod
|
|
3365
|
+
def mayRaiseExceptionOperation():
|
|
3366
|
+
return True
|
|
3367
|
+
|
|
3368
|
+
|
|
3369
|
+
class ExpressionSysExitRef(ExpressionImportModuleNameHardExistsSpecificBase):
|
|
3370
|
+
"""Function reference sys.exit"""
|
|
3371
|
+
|
|
3372
|
+
kind = "EXPRESSION_SYS_EXIT_REF"
|
|
3373
|
+
|
|
3374
|
+
def __init__(self, source_ref):
|
|
3375
|
+
ExpressionImportModuleNameHardExistsSpecificBase.__init__(
|
|
3376
|
+
self,
|
|
3377
|
+
module_name="sys",
|
|
3378
|
+
import_name="exit",
|
|
3379
|
+
module_guaranteed=True,
|
|
3380
|
+
source_ref=source_ref,
|
|
3381
|
+
)
|
|
3382
|
+
|
|
3383
|
+
def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):
|
|
3384
|
+
# Anything may happen on call trace before this. On next pass, if
|
|
3385
|
+
# replaced, we might be better but not now.
|
|
3386
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
3387
|
+
|
|
3388
|
+
from .OsSysNodes import makeExpressionSysExitCall
|
|
3389
|
+
|
|
3390
|
+
result = extractBuiltinArgs(
|
|
3391
|
+
node=call_node,
|
|
3392
|
+
builtin_class=makeExpressionSysExitCall,
|
|
3393
|
+
builtin_spec=sys_exit_spec,
|
|
3394
|
+
)
|
|
3395
|
+
|
|
3396
|
+
return (
|
|
3397
|
+
result,
|
|
3398
|
+
"new_expression",
|
|
3399
|
+
"Call to 'sys.exit' recognized.",
|
|
3400
|
+
)
|
|
3401
|
+
|
|
3402
|
+
|
|
3403
|
+
hard_import_node_classes[ExpressionSysExitRef] = sys_exit_spec
|
|
3404
|
+
|
|
3405
|
+
|
|
3406
|
+
class ExpressionSysExitCallBase(ChildHavingExitCodeOptionalMixin, ExpressionBase):
|
|
3407
|
+
"""Base class for SysExitCall
|
|
3408
|
+
|
|
3409
|
+
Generated boiler plate code from 'HardImportCallNode.py.j2' template.
|
|
3410
|
+
"""
|
|
3411
|
+
|
|
3412
|
+
named_children = ("exit_code|optional",)
|
|
3413
|
+
|
|
3414
|
+
__slots__ = ("attempted",)
|
|
3415
|
+
|
|
3416
|
+
spec = sys_exit_spec
|
|
3417
|
+
|
|
3418
|
+
def __init__(self, exit_code, source_ref):
|
|
3419
|
+
|
|
3420
|
+
ChildHavingExitCodeOptionalMixin.__init__(
|
|
3421
|
+
self,
|
|
3422
|
+
exit_code=exit_code,
|
|
3423
|
+
)
|
|
3424
|
+
|
|
3425
|
+
ExpressionBase.__init__(self, source_ref)
|
|
3426
|
+
|
|
3427
|
+
# In module mode, we expect a changing environment, cannot optimize this
|
|
3428
|
+
self.attempted = shallMakeModule()
|
|
3429
|
+
|
|
3430
|
+
def computeExpression(self, trace_collection):
|
|
3431
|
+
if self.attempted or not sys_exit_spec.isCompileTimeComputable(
|
|
3432
|
+
(self.subnode_exit_code,)
|
|
3433
|
+
):
|
|
3434
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
3435
|
+
|
|
3436
|
+
return self, None, None
|
|
3437
|
+
|
|
3438
|
+
try:
|
|
3439
|
+
return self.replaceWithCompileTimeValue(trace_collection)
|
|
3440
|
+
finally:
|
|
3441
|
+
self.attempted = True
|
|
3442
|
+
|
|
3443
|
+
@abstractmethod
|
|
3444
|
+
def replaceWithCompileTimeValue(self, trace_collection):
|
|
3445
|
+
pass
|
|
3446
|
+
|
|
3447
|
+
@staticmethod
|
|
3448
|
+
def mayRaiseExceptionOperation():
|
|
3449
|
+
return True
|
|
3450
|
+
|
|
3451
|
+
|
|
3452
|
+
class ExpressionTensorflowFunctionRef(ExpressionImportModuleNameHardExistsSpecificBase):
|
|
3453
|
+
"""Function reference tensorflow.function"""
|
|
3454
|
+
|
|
3455
|
+
kind = "EXPRESSION_TENSORFLOW_FUNCTION_REF"
|
|
3456
|
+
|
|
3457
|
+
def __init__(self, source_ref):
|
|
3458
|
+
ExpressionImportModuleNameHardExistsSpecificBase.__init__(
|
|
3459
|
+
self,
|
|
3460
|
+
module_name="tensorflow",
|
|
3461
|
+
import_name="function",
|
|
3462
|
+
module_guaranteed=not shallMakeModule(),
|
|
3463
|
+
source_ref=source_ref,
|
|
3464
|
+
)
|
|
3465
|
+
|
|
3466
|
+
def computeExpressionCall(self, call_node, call_args, call_kw, trace_collection):
|
|
3467
|
+
# Anything may happen on call trace before this. On next pass, if
|
|
3468
|
+
# replaced, we might be better but not now.
|
|
3469
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
3470
|
+
|
|
3471
|
+
from .TensorflowNodes import ExpressionTensorflowFunctionCall
|
|
3472
|
+
|
|
3473
|
+
result = extractBuiltinArgs(
|
|
3474
|
+
node=call_node,
|
|
3475
|
+
builtin_class=ExpressionTensorflowFunctionCall,
|
|
3476
|
+
builtin_spec=tensorflow_function_spec,
|
|
3477
|
+
)
|
|
3478
|
+
|
|
3479
|
+
return (
|
|
3480
|
+
result,
|
|
3481
|
+
"new_expression",
|
|
3482
|
+
"Call to 'tensorflow.function' recognized.",
|
|
3483
|
+
)
|
|
3484
|
+
|
|
3485
|
+
|
|
3486
|
+
hard_import_node_classes[ExpressionTensorflowFunctionRef] = tensorflow_function_spec
|
|
3487
|
+
|
|
3488
|
+
|
|
3489
|
+
class ExpressionTensorflowFunctionCallBase(
|
|
3490
|
+
ChildrenHavingFuncOptionalInputSignatureOptionalAutographOptionalJitCompileOptionalReduceRetracingOptionalExperimentalImplementsOptionalExperimentalAutographOptionsOptionalExperimentalAttributesOptionalExperimentalRelaxShapesOptionalExperimentalCompileOptionalExperimentalFollowTypeHintsOptionalMixin,
|
|
3491
|
+
ExpressionBase,
|
|
3492
|
+
):
|
|
3493
|
+
"""Base class for TensorflowFunctionCall
|
|
3494
|
+
|
|
3495
|
+
Generated boiler plate code from 'HardImportCallNode.py.j2' template.
|
|
3496
|
+
"""
|
|
3497
|
+
|
|
3498
|
+
named_children = (
|
|
3499
|
+
"func|optional",
|
|
3500
|
+
"input_signature|optional",
|
|
3501
|
+
"autograph|optional",
|
|
3502
|
+
"jit_compile|optional",
|
|
3503
|
+
"reduce_retracing|optional",
|
|
3504
|
+
"experimental_implements|optional",
|
|
3505
|
+
"experimental_autograph_options|optional",
|
|
3506
|
+
"experimental_attributes|optional",
|
|
3507
|
+
"experimental_relax_shapes|optional",
|
|
3508
|
+
"experimental_compile|optional",
|
|
3509
|
+
"experimental_follow_type_hints|optional",
|
|
3510
|
+
)
|
|
3511
|
+
|
|
3512
|
+
__slots__ = ("attempted",)
|
|
3513
|
+
|
|
3514
|
+
spec = tensorflow_function_spec
|
|
3515
|
+
|
|
3516
|
+
def __init__(
|
|
3517
|
+
self,
|
|
3518
|
+
func,
|
|
3519
|
+
input_signature,
|
|
3520
|
+
autograph,
|
|
3521
|
+
jit_compile,
|
|
3522
|
+
reduce_retracing,
|
|
3523
|
+
experimental_implements,
|
|
3524
|
+
experimental_autograph_options,
|
|
3525
|
+
experimental_attributes,
|
|
3526
|
+
experimental_relax_shapes,
|
|
3527
|
+
experimental_compile,
|
|
3528
|
+
experimental_follow_type_hints,
|
|
3529
|
+
source_ref,
|
|
3530
|
+
):
|
|
3531
|
+
|
|
3532
|
+
ChildrenHavingFuncOptionalInputSignatureOptionalAutographOptionalJitCompileOptionalReduceRetracingOptionalExperimentalImplementsOptionalExperimentalAutographOptionsOptionalExperimentalAttributesOptionalExperimentalRelaxShapesOptionalExperimentalCompileOptionalExperimentalFollowTypeHintsOptionalMixin.__init__(
|
|
3533
|
+
self,
|
|
3534
|
+
func=func,
|
|
3535
|
+
input_signature=input_signature,
|
|
3536
|
+
autograph=autograph,
|
|
3537
|
+
jit_compile=jit_compile,
|
|
3538
|
+
reduce_retracing=reduce_retracing,
|
|
3539
|
+
experimental_implements=experimental_implements,
|
|
3540
|
+
experimental_autograph_options=experimental_autograph_options,
|
|
3541
|
+
experimental_attributes=experimental_attributes,
|
|
3542
|
+
experimental_relax_shapes=experimental_relax_shapes,
|
|
3543
|
+
experimental_compile=experimental_compile,
|
|
3544
|
+
experimental_follow_type_hints=experimental_follow_type_hints,
|
|
3545
|
+
)
|
|
3546
|
+
|
|
3547
|
+
ExpressionBase.__init__(self, source_ref)
|
|
3548
|
+
|
|
3549
|
+
# In module mode, we expect a changing environment, cannot optimize this
|
|
3550
|
+
self.attempted = shallMakeModule()
|
|
3551
|
+
|
|
3552
|
+
def computeExpression(self, trace_collection):
|
|
3553
|
+
if self.attempted or not tensorflow_function_spec.isCompileTimeComputable(
|
|
3554
|
+
(
|
|
3555
|
+
self.subnode_func,
|
|
3556
|
+
self.subnode_input_signature,
|
|
3557
|
+
self.subnode_autograph,
|
|
3558
|
+
self.subnode_jit_compile,
|
|
3559
|
+
self.subnode_reduce_retracing,
|
|
3560
|
+
self.subnode_experimental_implements,
|
|
3561
|
+
self.subnode_experimental_autograph_options,
|
|
3562
|
+
self.subnode_experimental_attributes,
|
|
3563
|
+
self.subnode_experimental_relax_shapes,
|
|
3564
|
+
self.subnode_experimental_compile,
|
|
3565
|
+
self.subnode_experimental_follow_type_hints,
|
|
3566
|
+
)
|
|
3567
|
+
):
|
|
3568
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
3569
|
+
|
|
3570
|
+
return self, None, None
|
|
3571
|
+
|
|
3572
|
+
try:
|
|
3573
|
+
return self.replaceWithCompileTimeValue(trace_collection)
|
|
3574
|
+
finally:
|
|
3575
|
+
self.attempted = True
|
|
3576
|
+
|
|
3577
|
+
@abstractmethod
|
|
3578
|
+
def replaceWithCompileTimeValue(self, trace_collection):
|
|
3579
|
+
pass
|
|
3580
|
+
|
|
3581
|
+
@staticmethod
|
|
3582
|
+
def mayRaiseExceptionOperation():
|
|
3583
|
+
return True
|
|
3584
|
+
|
|
3585
|
+
|
|
3586
|
+
# Part of "Nuitka", an optimizing Python compiler that is compatible and
|
|
3587
|
+
# integrates with CPython, but also works on its own.
|
|
3588
|
+
#
|
|
3589
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
3590
|
+
# you may not use this file except in compliance with the License.
|
|
3591
|
+
# You may obtain a copy of the License at
|
|
3592
|
+
#
|
|
3593
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
3594
|
+
#
|
|
3595
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
3596
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
3597
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3598
|
+
# See the License for the specific language governing permissions and
|
|
3599
|
+
# limitations under the License.
|