aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/tools/python3/Python
diff options
context:
space:
mode:
authorsnermolaev <snermolaev@yandex-team.com>2025-04-29 06:44:21 +0300
committersnermolaev <snermolaev@yandex-team.com>2025-04-29 06:57:18 +0300
commit713adc6a88be8af8a342a9a72a055b7ef6514563 (patch)
tree19dada616a0fd41ead73ad79d463a11c6cd8279d /contrib/tools/python3/Python
parent407f7c0bc156862b8263bccf3eaaf0687ba75f8d (diff)
downloadydb-713adc6a88be8af8a342a9a72a055b7ef6514563.tar.gz
Subinterpretor compatible __res module (2nd attempt)
Cython is not yet subinterpreter compatible. There are no ETA when cython is going to support subinterpreters. This PR removes cython from hermetic python imoprt hooks in order to make them subinterpretr-compatible. commit_hash:427b6f9db6afa6695659ee147621e1ccb391d3cb
Diffstat (limited to 'contrib/tools/python3/Python')
-rw-r--r--contrib/tools/python3/Python/_warnings.c4
-rw-r--r--contrib/tools/python3/Python/import.c2
2 files changed, 5 insertions, 1 deletions
diff --git a/contrib/tools/python3/Python/_warnings.c b/contrib/tools/python3/Python/_warnings.c
index 1f91edbf5cb..f0ab47efb64 100644
--- a/contrib/tools/python3/Python/_warnings.c
+++ b/contrib/tools/python3/Python/_warnings.c
@@ -791,6 +791,10 @@ is_internal_filename(PyObject *filename)
}
}
+ if (_PyUnicode_EqualToASCIIString(filename, "library/python/runtime_py3/__res.py")) {
+ return true;
+ }
+
return false;
}
diff --git a/contrib/tools/python3/Python/import.c b/contrib/tools/python3/Python/import.c
index daac00593d7..1b550d0451c 100644
--- a/contrib/tools/python3/Python/import.c
+++ b/contrib/tools/python3/Python/import.c
@@ -2523,7 +2523,7 @@ remove_importlib_frames(PyThreadState *tstate)
{
const char *importlib_filename = "<frozen importlib._bootstrap>";
const char *external_filename = "<frozen importlib._bootstrap_external>";
- const char *importer_filename = "library/python/runtime_py3/importer.pxi";
+ const char *importer_filename = "library/python/runtime_py3/__res.py";
const char *remove_frames = "_call_with_frames_removed";
int always_trim = 0;
int in_importlib = 0;