diff options
author | robot-piglet <robot-piglet@yandex-team.com> | 2024-02-18 14:26:38 +0300 |
---|---|---|
committer | robot-piglet <robot-piglet@yandex-team.com> | 2024-02-18 14:36:02 +0300 |
commit | 33ea4d52a7e5bdde6d5541ae6b10d9d32940f31d (patch) | |
tree | d0ce4f5212713e4c7057a0e311a2f3259111fd3b | |
parent | 36417997de1f3831e0d74d4dd4ee1595c76d4977 (diff) | |
download | ydb-33ea4d52a7e5bdde6d5541ae6b10d9d32940f31d.tar.gz |
Intermediate changes
-rw-r--r-- | contrib/libs/clang14/include/ya.make | 4 | ||||
-rw-r--r-- | contrib/libs/clang16/include/ya.make | 8 | ||||
-rw-r--r-- | contrib/python/hypothesis/py3/.dist-info/METADATA | 2 | ||||
-rw-r--r-- | contrib/python/hypothesis/py3/hypothesis/control.py | 25 | ||||
-rw-r--r-- | contrib/python/hypothesis/py3/hypothesis/core.py | 8 | ||||
-rw-r--r-- | contrib/python/hypothesis/py3/hypothesis/internal/conjecture/data.py | 3 | ||||
-rw-r--r-- | contrib/python/hypothesis/py3/hypothesis/internal/observability.py | 18 | ||||
-rw-r--r-- | contrib/python/hypothesis/py3/hypothesis/stateful.py | 11 | ||||
-rw-r--r-- | contrib/python/hypothesis/py3/hypothesis/version.py | 2 | ||||
-rw-r--r-- | contrib/python/hypothesis/py3/ya.make | 2 | ||||
-rw-r--r-- | contrib/tools/python3/bin/ya.make (renamed from contrib/tools/python3/ya.make) | 13 | ||||
-rw-r--r-- | contrib/tools/python3/patches/all-changes.patch | 339 |
12 files changed, 63 insertions, 372 deletions
diff --git a/contrib/libs/clang14/include/ya.make b/contrib/libs/clang14/include/ya.make index 19711defc3..707428781d 100644 --- a/contrib/libs/clang14/include/ya.make +++ b/contrib/libs/clang14/include/ya.make @@ -802,7 +802,7 @@ RUN_PROGRAM( ) RUN_PROGRAM( - contrib/tools/python3 contrib/libs/clang14/lib/Tooling/DumpTool/generate_cxx_src_locs.py --json-input-path + contrib/tools/python3/bin contrib/libs/clang14/lib/Tooling/DumpTool/generate_cxx_src_locs.py --json-input-path contrib/libs/clang14/lib/Tooling/ASTNodeAPI.json --output-file clang/Tooling/NodeIntrospection.inc --use-empty-implementation 0 --empty-implementation contrib/libs/clang14/lib/Tooling/EmptyNodeIntrospection.inc.in @@ -856,7 +856,7 @@ RUN_PROGRAM( ) RUN_PROGRAM( - contrib/tools/python3 ${ARCADIA_ROOT}/contrib/libs/clang14/include/yamaker_mkdepdir.py + contrib/tools/python3/bin ${ARCADIA_ROOT}/contrib/libs/clang14/include/yamaker_mkdepdir.py ${ARCADIA_BUILD_ROOT}/contrib/libs/clang14/lib/Tooling CWD ${ARCADIA_BUILD_ROOT}/contrib/libs/clang14 OUT_NOAUTO ${ARCADIA_BUILD_ROOT}/contrib/libs/clang14/lib/Tooling/yamaker_mock.dep diff --git a/contrib/libs/clang16/include/ya.make b/contrib/libs/clang16/include/ya.make index 5e1b6d8165..8dd83cf4d7 100644 --- a/contrib/libs/clang16/include/ya.make +++ b/contrib/libs/clang16/include/ya.make @@ -806,9 +806,9 @@ RUN_PROGRAM( ) RUN_PROGRAM( - contrib/tools/python3 contrib/libs/clang16/lib/Tooling/DumpTool/generate_cxx_src_locs.py --json-input-path - contrib/libs/clang16/lib/Tooling/ASTNodeAPI.json --output-file clang/Tooling/NodeIntrospection.inc - --use-empty-implementation 0 --empty-implementation + contrib/tools/python3/bin contrib/libs/clang16/lib/Tooling/DumpTool/generate_cxx_src_locs.py + --json-input-path contrib/libs/clang16/lib/Tooling/ASTNodeAPI.json --output-file + clang/Tooling/NodeIntrospection.inc --use-empty-implementation 0 --empty-implementation contrib/libs/clang16/lib/Tooling/EmptyNodeIntrospection.inc.in CWD ${ARCADIA_BUILD_ROOT}/contrib/libs/clang16/lib/Tooling IN ${ARCADIA_BUILD_ROOT}/contrib/libs/clang16/lib/Tooling/yamaker_mock.dep @@ -882,7 +882,7 @@ RUN_PROGRAM( ) RUN_PROGRAM( - contrib/tools/python3 ${ARCADIA_ROOT}/contrib/libs/clang16/include/yamaker_mkdepdir.py + contrib/tools/python3/bin ${ARCADIA_ROOT}/contrib/libs/clang16/include/yamaker_mkdepdir.py ${ARCADIA_BUILD_ROOT}/contrib/libs/clang16/lib/Tooling CWD ${ARCADIA_BUILD_ROOT}/contrib/libs/clang16 OUT_NOAUTO ${ARCADIA_BUILD_ROOT}/contrib/libs/clang16/lib/Tooling/yamaker_mock.dep diff --git a/contrib/python/hypothesis/py3/.dist-info/METADATA b/contrib/python/hypothesis/py3/.dist-info/METADATA index 04454aaec7..22fef6f6ba 100644 --- a/contrib/python/hypothesis/py3/.dist-info/METADATA +++ b/contrib/python/hypothesis/py3/.dist-info/METADATA @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: hypothesis -Version: 6.97.4 +Version: 6.97.5 Summary: A library for property-based testing Home-page: https://hypothesis.works Author: David R. MacIver and Zac Hatfield-Dodds diff --git a/contrib/python/hypothesis/py3/hypothesis/control.py b/contrib/python/hypothesis/py3/hypothesis/control.py index 92b26069c5..f4a400072f 100644 --- a/contrib/python/hypothesis/py3/hypothesis/control.py +++ b/contrib/python/hypothesis/py3/hypothesis/control.py @@ -11,7 +11,7 @@ import inspect import math from collections import defaultdict -from typing import NoReturn, Union +from typing import Any, NoReturn, Union from weakref import WeakKeyDictionary from hypothesis import Verbosity, settings @@ -19,6 +19,7 @@ from hypothesis._settings import note_deprecation from hypothesis.errors import InvalidArgument, UnsatisfiedAssumption from hypothesis.internal.compat import BaseExceptionGroup from hypothesis.internal.conjecture.data import ConjectureData +from hypothesis.internal.observability import TESTCASE_CALLBACKS from hypothesis.internal.reflection import get_pretty_function_description from hypothesis.internal.validation import check_type from hypothesis.reporting import report, verbose_report @@ -26,8 +27,9 @@ from hypothesis.utils.dynamicvariables import DynamicVariable from hypothesis.vendor.pretty import IDKey, pretty -def _calling_function_name(frame): - return frame.f_back.f_code.co_name +def _calling_function_location(what: str, frame: Any) -> str: + where = frame.f_back + return f"{what}() in {where.f_code.co_name} (line {where.f_lineno})" def reject() -> NoReturn: @@ -37,8 +39,11 @@ def reject() -> NoReturn: since="2023-09-25", has_codemod=False, ) - f = _calling_function_name(inspect.currentframe()) - raise UnsatisfiedAssumption(f"reject() in {f}") + where = _calling_function_location("reject", inspect.currentframe()) + if currently_in_test_context(): + count = current_build_context().data._observability_predicates[where] + count["unsatisfied"] += 1 + raise UnsatisfiedAssumption(where) def assume(condition: object) -> bool: @@ -54,9 +59,13 @@ def assume(condition: object) -> bool: since="2023-09-25", has_codemod=False, ) - if not condition: - f = _calling_function_name(inspect.currentframe()) - raise UnsatisfiedAssumption(f"failed to satisfy assume() in {f}") + if TESTCASE_CALLBACKS or not condition: + where = _calling_function_location("assume", inspect.currentframe()) + if TESTCASE_CALLBACKS and currently_in_test_context(): + predicates = current_build_context().data._observability_predicates + predicates[where]["satisfied" if condition else "unsatisfied"] += 1 + if not condition: + raise UnsatisfiedAssumption(f"failed to satisfy {where}") return True diff --git a/contrib/python/hypothesis/py3/hypothesis/core.py b/contrib/python/hypothesis/py3/hypothesis/core.py index 601c33e176..e000da174f 100644 --- a/contrib/python/hypothesis/py3/hypothesis/core.py +++ b/contrib/python/hypothesis/py3/hypothesis/core.py @@ -91,6 +91,7 @@ from hypothesis.internal.healthcheck import fail_health_check from hypothesis.internal.observability import ( OBSERVABILITY_COLLECT_COVERAGE, TESTCASE_CALLBACKS, + _system_metadata, deliver_json_blob, make_testcase, ) @@ -1066,7 +1067,6 @@ class StateForActualGivenExecution: string_repr=self._string_repr, arguments={**self._jsonable_arguments, **data._observability_args}, timing=self._timing_features, - metadata={}, coverage=tractable_coverage_report(trace) or None, ) deliver_json_blob(tc) @@ -1195,7 +1195,11 @@ class StateForActualGivenExecution: }, "timing": self._timing_features, "coverage": None, # Not recorded when we're replaying the MFE - "metadata": {"traceback": tb}, + "metadata": { + "traceback": tb, + "predicates": ran_example._observability_predicates, + **_system_metadata(), + }, } deliver_json_blob(tc) # Whether or not replay actually raised the exception again, we want diff --git a/contrib/python/hypothesis/py3/hypothesis/internal/conjecture/data.py b/contrib/python/hypothesis/py3/hypothesis/internal/conjecture/data.py index 8b8462d24d..4e43477c5e 100644 --- a/contrib/python/hypothesis/py3/hypothesis/internal/conjecture/data.py +++ b/contrib/python/hypothesis/py3/hypothesis/internal/conjecture/data.py @@ -1450,6 +1450,9 @@ class ConjectureData: self.arg_slices: Set[Tuple[int, int]] = set() self.slice_comments: Dict[Tuple[int, int], str] = {} self._observability_args: Dict[str, Any] = {} + self._observability_predicates: defaultdict = defaultdict( + lambda: {"satisfied": 0, "unsatisfied": 0} + ) self.extra_information = ExtraInformation() diff --git a/contrib/python/hypothesis/py3/hypothesis/internal/observability.py b/contrib/python/hypothesis/py3/hypothesis/internal/observability.py index eb083f8be1..98753985f1 100644 --- a/contrib/python/hypothesis/py3/hypothesis/internal/observability.py +++ b/contrib/python/hypothesis/py3/hypothesis/internal/observability.py @@ -13,8 +13,10 @@ import json import os import sys +import time import warnings from datetime import date, timedelta +from functools import lru_cache from typing import Callable, Dict, List, Optional from hypothesis.configuration import storage_directory @@ -38,7 +40,6 @@ def make_testcase( string_repr: str = "<unknown>", arguments: Optional[dict] = None, timing: Dict[str, float], - metadata: Optional[dict] = None, coverage: Optional[Dict[str, List[int]]] = None, ) -> dict: if data.interesting_origin: @@ -68,8 +69,9 @@ def make_testcase( }, "timing": timing, "metadata": { - **(metadata or {}), "traceback": getattr(data.extra_information, "_expected_traceback", None), + "predicates": data._observability_predicates, + **_system_metadata(), }, "coverage": coverage, } @@ -87,6 +89,18 @@ def _deliver_to_file(value): # pragma: no cover f.write(json.dumps(value) + "\n") +_imported_at = time.time() + + +@lru_cache +def _system_metadata(): + return { + "sys.argv": sys.argv, + "os.getpid()": os.getpid(), + "imported_at": _imported_at, + } + + OBSERVABILITY_COLLECT_COVERAGE = ( "HYPOTHESIS_EXPERIMENTAL_OBSERVABILITY_NOCOVER" not in os.environ ) diff --git a/contrib/python/hypothesis/py3/hypothesis/stateful.py b/contrib/python/hypothesis/py3/hypothesis/stateful.py index 39ce653981..14275d940e 100644 --- a/contrib/python/hypothesis/py3/hypothesis/stateful.py +++ b/contrib/python/hypothesis/py3/hypothesis/stateful.py @@ -116,6 +116,7 @@ def run_state_machine_as_test(state_machine_factory, *, settings=None, _min_step machine = factory() check_type(RuleBasedStateMachine, machine, "state_machine_factory()") cd.hypothesis_runner = machine + machine._observability_predicates = cd._observability_predicates # alias print_steps = ( current_build_context().is_final or current_verbosity() >= Verbosity.debug @@ -941,8 +942,14 @@ class RuleStrategy(SearchStrategy): return (rule, data.draw(rule.arguments_strategy)) def is_valid(self, rule): - if not all(precond(self.machine) for precond in rule.preconditions): - return False + predicates = self.machine._observability_predicates + desc = f"{self.machine.__class__.__qualname__}, rule {rule.function.__name__}," + for pred in rule.preconditions: + meets_precond = pred(self.machine) + where = f"{desc} precondition {get_pretty_function_description(pred)}" + predicates[where]["satisfied" if meets_precond else "unsatisfied"] += 1 + if not meets_precond: + return False for b in rule.bundles: bundle = self.machine.bundle(b.name) diff --git a/contrib/python/hypothesis/py3/hypothesis/version.py b/contrib/python/hypothesis/py3/hypothesis/version.py index 10be563628..307de471d0 100644 --- a/contrib/python/hypothesis/py3/hypothesis/version.py +++ b/contrib/python/hypothesis/py3/hypothesis/version.py @@ -8,5 +8,5 @@ # v. 2.0. If a copy of the MPL was not distributed with this file, You can # obtain one at https://mozilla.org/MPL/2.0/. -__version_info__ = (6, 97, 4) +__version_info__ = (6, 97, 5) __version__ = ".".join(map(str, __version_info__)) diff --git a/contrib/python/hypothesis/py3/ya.make b/contrib/python/hypothesis/py3/ya.make index e0530c7a9e..1914b61e35 100644 --- a/contrib/python/hypothesis/py3/ya.make +++ b/contrib/python/hypothesis/py3/ya.make @@ -2,7 +2,7 @@ PY3_LIBRARY() -VERSION(6.97.4) +VERSION(6.97.5) LICENSE(MPL-2.0) diff --git a/contrib/tools/python3/ya.make b/contrib/tools/python3/bin/ya.make index 36d93b491f..05c20b8848 100644 --- a/contrib/tools/python3/ya.make +++ b/contrib/tools/python3/bin/ya.make @@ -1,6 +1,6 @@ -# Generated by devtools/yamaker from nixpkgs 22.11. +# Generated by devtools/yamaker. -PROGRAM() +PROGRAM(python3) VERSION(3.12.2) @@ -19,14 +19,7 @@ CFLAGS( ) SRCS( - src/Programs/python.c + ../src/Programs/python.c ) END() - -RECURSE( - src - src/Lib - src/Modules - src/Modules/_sqlite -) diff --git a/contrib/tools/python3/patches/all-changes.patch b/contrib/tools/python3/patches/all-changes.patch deleted file mode 100644 index a837012670..0000000000 --- a/contrib/tools/python3/patches/all-changes.patch +++ /dev/null @@ -1,339 +0,0 @@ ---- contrib/tools/python3/src/Modules/posixmodule.c (index) -+++ contrib/tools/python3/src/Modules/posixmodule.c (working tree) -@@ -288,6 +288,7 @@ corresponding Unix manual entries for more information on calls."); - #endif - #ifdef HAVE_GETRANDOM_SYSCALL - # include <sys/syscall.h> -+# include <sys/random.h> - #endif - - #if defined(MS_WINDOWS) ---- contrib/tools/python3/src/Lib/ctypes/__init__.py (index) -+++ contrib/tools/python3/src/Lib/ctypes/__init__.py (working tree) -@@ -11,6 +11,7 @@ from _ctypes import CFuncPtr as _CFuncPtr - from _ctypes import RTLD_LOCAL, RTLD_GLOBAL - from _ctypes import ArgumentError - from _ctypes import SIZEOF_TIME_T -+from .util import find_library as _find_library - - from struct import calcsize as _calcsize - -@@ -372,8 +373,15 @@ class CDLL(object): - _restype_ = self._func_restype_ - self._FuncPtr = _FuncPtr - -+ self._builtin = {} -+ - if handle is None: -- self._handle = _dlopen(self._name, mode) -+ if isinstance(self._name, dict): -+ self._builtin = self._name['symbols'] -+ self._name = self._name['name'] -+ self._handle = 0 -+ else: -+ self._handle = _dlopen(self._name, mode) - else: - self._handle = handle - -@@ -391,7 +399,13 @@ class CDLL(object): - return func - - def __getitem__(self, name_or_ordinal): -- func = self._FuncPtr((name_or_ordinal, self)) -+ if self._builtin: -+ if name_or_ordinal not in self._builtin: -+ raise AttributeError("function %r not found" % name_or_ordinal) -+ func = self._FuncPtr(self._builtin[name_or_ordinal]) -+ else: -+ func = self._FuncPtr((name_or_ordinal, self)) -+ - if not isinstance(name_or_ordinal, int): - func.__name__ = name_or_ordinal - return func -@@ -458,12 +472,20 @@ class LibraryLoader(object): - cdll = LibraryLoader(CDLL) - pydll = LibraryLoader(PyDLL) - --if _os.name == "nt": -- pythonapi = PyDLL("python dll", None, _sys.dllhandle) --elif _sys.platform == "cygwin": -- pythonapi = PyDLL("libpython%d.%d.dll" % _sys.version_info[:2]) --else: -+#if _os.name == "nt": -+# pythonapi = PyDLL("python dll", None, _sys.dllhandle) -+#elif _sys.platform == "cygwin": -+# pythonapi = PyDLL("libpython%d.%d.dll" % _sys.version_info[:2]) -+#else: -+# pythonapi = PyDLL(None) -+ -+try: - pythonapi = PyDLL(None) -+except: -+ try: -+ pythonapi = PyDLL(_find_library('python')) -+ except: -+ pythonapi = PyDLL(dict(name='python', symbols={})) - - - if _os.name == "nt": ---- contrib/tools/python3/src/Lib/ctypes/util.py (index) -+++ contrib/tools/python3/src/Lib/ctypes/util.py (working tree) -@@ -329,6 +329,16 @@ elif os.name == "posix": - return _findSoname_ldconfig(name) or \ - _get_soname(_findLib_gcc(name)) or _get_soname(_findLib_ld(name)) - -+try: -+ from library.python.symbols.module import find_library as _find_library -+except ImportError: -+ pass -+else: -+ _next_find_library = find_library -+ -+ def find_library(name): -+ return _find_library(name, _next_find_library) -+ - ################################################################ - # test code - ---- contrib/tools/python3/src/Lib/doctest.py (index) -+++ contrib/tools/python3/src/Lib/doctest.py (working tree) -@@ -957,7 +957,7 @@ class DocTestFinder: - return module.__dict__ is object.__globals__ - elif (inspect.ismethoddescriptor(object) or - inspect.ismethodwrapper(object)): -- if hasattr(object, '__objclass__'): -+ if hasattr(object, '__objclass__') and hasattr(object.__objclass__, '__module__'): - obj_mod = object.__objclass__.__module__ - elif hasattr(object, '__module__'): - obj_mod = object.__module__ -@@ -965,7 +965,10 @@ class DocTestFinder: - return True # [XX] no easy way to tell otherwise - return module.__name__ == obj_mod - elif inspect.isclass(object): -- return module.__name__ == object.__module__ -+ try: -+ return module.__name__ == object.__module__ -+ except: -+ return True - elif hasattr(object, '__module__'): - return module.__name__ == object.__module__ - elif isinstance(object, property): ---- contrib/tools/python3/src/Lib/multiprocessing/popen_spawn_win32.py (index) -+++ contrib/tools/python3/src/Lib/multiprocessing/popen_spawn_win32.py (working tree) -@@ -65,5 +65,6 @@ class Popen(object): - env["__PYVENV_LAUNCHER__"] = sys.executable - else: -- env = None -+ env = os.environ.copy() -+ env['Y_PYTHON_ENTRY_POINT'] = ':main' - - cmd = ' '.join('"%s"' % x for x in cmd) ---- contrib/tools/python3/src/Lib/multiprocessing/spawn.py (index) -+++ contrib/tools/python3/src/Lib/multiprocessing/spawn.py (working tree) -@@ -82,7 +82,7 @@ def get_command_line(**kwds): - ''' - Returns prefix of command line used for spawning a child process - ''' -- if getattr(sys, 'frozen', False): -+ if False and getattr(sys, 'frozen', False): - return ([sys.executable, '--multiprocessing-fork'] + - ['%s=%r' % item for item in kwds.items()]) - else: ---- contrib/tools/python3/src/Lib/multiprocessing/util.py (index) -+++ contrib/tools/python3/src/Lib/multiprocessing/util.py (working tree) -@@ -383,8 +383,11 @@ class ForkAwareThreadLock(object): - - - class ForkAwareLocal(threading.local): -- def __init__(self): -- register_after_fork(self, lambda obj : obj.__dict__.clear()) -+ def __new__(cls): -+ self = threading.local.__new__(cls) -+ register_after_fork(self, lambda obj: obj.__dict__.clear()) -+ return self -+ - def __reduce__(self): - return type(self), () - -@@ -444,14 +447,26 @@ def _flush_std_streams(): - # Start a program with only specified fds kept open - # - -+ -+def _env_list(): -+ # Based on fork_exec in subprocess.py. -+ env = os.environ.copy() -+ env['Y_PYTHON_ENTRY_POINT'] = ':main' -+ env_list = [] -+ for k, v in env.items(): -+ if '=' not in k: -+ env_list.append(os.fsencode(k) + b'=' + os.fsencode(v)) -+ return env_list -+ -+ - def spawnv_passfds(path, args, passfds): - import _posixsubprocess - import subprocess - passfds = tuple(sorted(map(int, passfds))) - errpipe_read, errpipe_write = os.pipe() - try: - return _posixsubprocess.fork_exec( -- args, [path], True, passfds, None, None, -+ args, [path], True, passfds, None, _env_list(), - -1, -1, -1, -1, -1, -1, errpipe_read, errpipe_write, - False, False, -1, None, None, None, -1, None, - subprocess._USE_VFORK) ---- contrib/tools/python3/src/Modules/_ctypes/_ctypes.c (index) -+++ contrib/tools/python3/src/Modules/_ctypes/_ctypes.c (working tree) -@@ -109,6 +109,7 @@ bytes(cdata) - // windows.h must be included before pycore internal headers - #ifdef MS_WIN32 - # include <windows.h> -+# include <Unknwn.h> - #endif - - #include "pycore_call.h" // _PyObject_CallNoArgs() ---- contrib/tools/python3/src/Modules/_ctypes/callbacks.c (index) -+++ contrib/tools/python3/src/Modules/_ctypes/callbacks.c (working tree) -@@ -7,6 +7,7 @@ - // windows.h must be included before pycore internal headers - #ifdef MS_WIN32 - # include <windows.h> -+# include <Unknwn.h> - #endif - - #include "pycore_call.h" // _PyObject_CallNoArgs() ---- contrib/tools/python3/src/Modules/_ctypes/callproc.c (index) -+++ contrib/tools/python3/src/Modules/_ctypes/callproc.c (working tree) -@@ -63,6 +63,7 @@ - - #ifdef MS_WIN32 - #include <windows.h> -+#include <Unknwn.h> - #include <tchar.h> - #else - #include "ctypes_dlfcn.h" ---- contrib/tools/python3/src/Modules/_ctypes/cfield.c (index) -+++ contrib/tools/python3/src/Modules/_ctypes/cfield.c (working tree) -@@ -6,6 +6,7 @@ - // windows.h must be included before pycore internal headers - #ifdef MS_WIN32 - # include <windows.h> -+# include <Unknwn.h> - #endif - - #include "pycore_bitutils.h" // _Py_bswap32() ---- contrib/tools/python3/src/Modules/_ctypes/stgdict.c (index) -+++ contrib/tools/python3/src/Modules/_ctypes/stgdict.c (working tree) -@@ -7,6 +7,7 @@ - // windows.h must be included before pycore internal headers - #ifdef MS_WIN32 - # include <windows.h> -+# include <Unknwn.h> - #endif - - #include "pycore_call.h" // _PyObject_CallNoArgs() ---- contrib/tools/python3/src/Modules/_decimal/libmpdec/io.c (index) -+++ contrib/tools/python3/src/Modules/_decimal/libmpdec/io.c (working tree) -@@ -37,7 +37,7 @@ - #include <stdlib.h> - #include <string.h> - --#include "io.h" -+#include "mpd_io.h" - #include "typearith.h" - - ---- contrib/tools/python3/src/Modules/_decimal/libmpdec/mpdecimal.h (index) -+++ contrib/tools/python3/src/Modules/_decimal/libmpdec/mpdecimal.h (working tree) -@@ -96,17 +96,17 @@ const char *mpd_version(void); - /* Configuration */ - /******************************************************************************/ - --#if defined(UNIVERSAL) -+#if 1 - #if defined(CONFIG_64) || defined(CONFIG_32) - #error "cannot use CONFIG_64 or CONFIG_32 with UNIVERSAL." - #endif -- #if defined(__ppc__) -- #define CONFIG_32 -- #define ANSI -- #elif defined(__ppc64__) -+ #if defined(__powerpc64__) || defined(_M_AMD64) || defined(__aarch64__) - #define CONFIG_64 - #define ANSI -- #elif defined(__i386__) -+ #elif defined(__powerpc__) -+ #define CONFIG_32 -+ #define ANSI -+ #elif defined(__i386__) || defined(_M_IX86) - #define CONFIG_32 - #define ANSI - #elif defined(__x86_64__) ---- contrib/tools/python3/src/Modules/getpath.c (index) -+++ contrib/tools/python3/src/Modules/getpath.c (working tree) -@@ -1,3 +1,4 @@ -+#define PYTHONPATH ":" - /* Return the initial module search path. */ - - #include "Python.h" ---- contrib/tools/python3/src/Modules/main.c (index) -+++ contrib/tools/python3/src/Modules/main.c (working tree) -@@ -51,6 +51,7 @@ pymain_init(const _PyArgv *args) - - PyConfig config; - PyConfig_InitPythonConfig(&config); -+ config.pathconfig_warnings = 0; /* Suppress errors from getpath.c */ - - /* pass NULL as the config: config is read from command line arguments, - environment variables, configuration files */ ---- contrib/tools/python3/src/PC/pyconfig.h (index) -+++ contrib/tools/python3/src/PC/pyconfig.h (working tree) -@@ -306,10 +306,6 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */ - # endif - #endif - --#ifdef _DEBUG --# define Py_DEBUG --#endif -- - - #ifdef MS_WIN32 - -@@ -460,7 +456,9 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */ - /* #define WITH_READLINE 1 */ - - /* Use Python's own small-block memory-allocator. */ -+#ifndef address_sanitizer_enabled - #define WITH_PYMALLOC 1 -+#endif - - /* Define if you want to compile in object freelists optimization */ - #define WITH_FREELISTS 1 ---- contrib/tools/python3/src/Python/initconfig.c (index) -+++ contrib/tools/python3/src/Python/initconfig.c (working tree) -@@ -163,7 +163,7 @@ int Py_InspectFlag = 0; /* Needed to determine whether to exit at SystemExit */ - int Py_OptimizeFlag = 0; /* Needed by compile.c */ - int Py_NoSiteFlag = 0; /* Suppress 'import site' */ - int Py_BytesWarningFlag = 0; /* Warn on str(bytes) and str(buffer) */ --int Py_FrozenFlag = 0; /* Needed by getpath.c */ -+int Py_FrozenFlag = 1; /* Needed by getpath.c */ - int Py_IgnoreEnvironmentFlag = 0; /* e.g. PYTHONPATH, PYTHONHOME */ - int Py_DontWriteBytecodeFlag = 0; /* Suppress writing bytecode files (*.pyc) */ - int Py_NoUserSiteDirectory = 0; /* for -s and site.py */ ---- contrib/tools/python3/src/Python/import.c (index) -+++ contrib/tools/python3/src/Python/import.c (working tree) -@@ -2101,6 +2101,13 @@ init_importlib_external(PyInterpreterState *interp) - return -1; - } - Py_DECREF(value); -+ -+ value = PyImport_ImportModule("__res"); -+ if (value == NULL) { -+ return -1; -+ } -+ Py_DECREF(value); -+ - return 0; - } - |