aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Tismer <tismer@stackless.com>2023-01-12 09:03:24 +0000
committerChristian Tismer <tismer@stackless.com>2023-01-12 09:08:57 +0000
commit3ab0ae305fa18b5f076588fdbbf55ac03210f008 (patch)
tree046fc150014aad7f34372e18544d9a05bbcfbfea
parentc8b8d0868bafe25e11f48ddc7a928ca1d47879ae (diff)
Revert "shiboken: de-virtualize the Python files"
This reverts commit c8b8d0868bafe25e11f48ddc7a928ca1d47879ae. Reason for revert: unsafe Change-Id: Ic90e0e54ad2573d565ea43bfaed2b4a748fc00fa Pick-to: 6.4 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
-rw-r--r--sources/shiboken6/libshiboken/embed/signature_bootstrap.py36
1 files changed, 1 insertions, 35 deletions
diff --git a/sources/shiboken6/libshiboken/embed/signature_bootstrap.py b/sources/shiboken6/libshiboken/embed/signature_bootstrap.py
index 72c042b46..c11a0367a 100644
--- a/sources/shiboken6/libshiboken/embed/signature_bootstrap.py
+++ b/sources/shiboken6/libshiboken/embed/signature_bootstrap.py
@@ -26,7 +26,6 @@ recursion_trap = 0
import base64
import importlib
import io
-import os
import sys
import traceback
import zipfile
@@ -72,44 +71,11 @@ def bootstrap():
sys.exit(-1)
target.remove(support_path)
- # Here we decide if re we-incarnate the embedded files or use embedding.
- incarnated = re_incarnate_files()
- if incarnated:
- target, support_path = sys.path, os.fspath(incarnated)
- else:
- target, support_path = prepare_zipfile()
- # PYSIDE-962: pre-load needed after re_incarnate_files [Windows, Py3.7.9]
- ensure_shibokensupport(target, support_path)
+ target, support_path = prepare_zipfile()
with ensure_shibokensupport(target, support_path):
from shibokensupport.signature import loader
return loader
-# Newer functionality:
-# This function checks if the support directory exist and returns it.
-# If does not exist, we try to create it and return it.
-# Otherwise, we return None.
-
-def re_incarnate_files():
- import shiboken6 as root
- files_dir = Path(root.__file__).resolve().parent / "files.dir"
- if files_dir.exists():
- return files_dir
-
- target, zip = prepare_zipfile()
- names = (_ for _ in zip.zfile.namelist() if _.endswith(".py"))
- try:
- # first check mkdir to get an error when we cannot write.
- files_dir.mkdir()
- except os.error:
- return None
- try:
- # Then check for a real error when unpacking the zip file.
- zip.zfile.extractall(path=files_dir, members=names)
- return files_dir
- except Exception as e:
- print('Exception:', e)
- traceback.print_exc(file=sys.stdout)
- raise
# New functionality: Loading from a zip archive.
# There exists the zip importer, but as it is written, only real zip files are