[Lldb-commits] [PATCH] D141042: [lldb] Allow configuring on Windows with python interpreter within a junction

Markus Böck via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Jan 6 00:58:39 PST 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rG9e84e038447e: [lldb] Allow configuring on Windows with python interpreter within a junction (authored by zero9178).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D141042/new/

https://reviews.llvm.org/D141042

Files:
  lldb/bindings/python/get-python-config.py


Index: lldb/bindings/python/get-python-config.py
===================================================================
--- lldb/bindings/python/get-python-config.py
+++ lldb/bindings/python/get-python-config.py
@@ -51,8 +51,10 @@
                 break
             except ValueError:
                 tried.append(exe)
-                if os.path.islink(exe):
-                    exe = os.path.join(os.path.realpath(os.path.dirname(exe)), os.readlink(exe))
+                # Retry if the executable is symlinked or similar.
+                # This is roughly equal to os.path.islink, except it also works for junctions on Windows.
+                if os.path.realpath(exe) != exe:
+                    exe = os.path.realpath(exe)
                     continue
                 else:
                     print("Could not find a relative path to sys.executable under sys.prefix", file=sys.stderr)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D141042.486771.patch
Type: text/x-patch
Size: 897 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20230106/ab9331df/attachment.bin>


More information about the lldb-commits mailing list