diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-12-25 15:21:24 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-01-01 14:06:23 +0100 |
commit | 131a1c17eed13171bf09ba42b2205760580e4f24 (patch) | |
tree | e17b90dea4aa17674377ebbc3ff5f6eec846dc5c /sources | |
parent | 2a2982339cd83107403cb73bf6f7451cac5f7b43 (diff) |
signature: Fix infinite loop changing up directories
Break out of the loop when dirname() returns the identical string.
Fixes: PYSIDE-1460
Pick-to: 6.0 5.15
Change-Id: I31a53946bb302758acb196f47a9ad605edfdd667
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources')
-rw-r--r-- | sources/shiboken6/libshiboken/embed/signature_bootstrap.py | 7 |
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" |