aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2020-12-25 15:21:24 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-01-01 14:18:37 +0000
commit86be8c1ca5936680d65bde8817c5ba09238e3700 (patch)
treeab6044a87fa5515c61aed021424f9c8566493e55
parentd465369f690ca4d7c3d824575e2b47899a1df6f4 (diff)
signature: Fix infinite loop changing up directories
Break out of the loop when dirname() returns the identical string. Fixes: PYSIDE-1460 Change-Id: I31a53946bb302758acb196f47a9ad605edfdd667 Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit 131a1c17eed13171bf09ba42b2205760580e4f24) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--sources/shiboken6/libshiboken/embed/signature_bootstrap.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/sources/shiboken6/libshiboken/embed/signature_bootstrap.py b/sources/shiboken6/libshiboken/embed/signature_bootstrap.py
index f193fde3a..287d349b4 100644
--- a/sources/shiboken6/libshiboken/embed/signature_bootstrap.py
+++ b/sources/shiboken6/libshiboken/embed/signature_bootstrap.py
@@ -108,8 +108,11 @@ def bootstrap():
rp = os.path.realpath(os.path.dirname(root.__file__))
# This can be the shiboken6 directory or the binary module, so search.
look_for = os.path.join("files.dir", "shibokensupport", "signature", "loader.py")
- while len(rp) > 3 and not os.path.exists(os.path.join(rp, look_for)):
- rp = os.path.abspath(os.path.join(rp, ".."))
+ while not os.path.exists(os.path.join(rp, look_for)):
+ dir = os.path.dirname(rp)
+ if dir == rp: # Hit root, '/', 'C:\', '\\server\share'
+ break
+ rp = dir
# Here we decide if we work embedded or not.
embedding_var = "pyside_uses_embedding"