mirror of
https://github.com/microsoft/debugpy.git
synced 2025-12-23 08:48:12 +00:00
Fix path modification for windows filesystems that can't handle .. (#1752)
This commit is contained in:
parent
3823aba95e
commit
a78e5c28cd
1 changed files with 7 additions and 1 deletions
|
|
@ -211,7 +211,13 @@ if __name__ == "__main__":
|
|||
# future imports of it or its submodules will resolve accordingly.
|
||||
if "debugpy" not in sys.modules:
|
||||
# Do not use dirname() to walk up - this can be a relative path, e.g. ".".
|
||||
sys.path[0] = sys.path[0] + "/../../"
|
||||
if os.name == "nt":
|
||||
import pathlib
|
||||
|
||||
windows_path = pathlib.Path(sys.path[0])
|
||||
sys.path[0] = str(windows_path.parent.parent)
|
||||
else:
|
||||
sys.path[0] = sys.path[0] + "/../../"
|
||||
__import__("debugpy")
|
||||
del sys.path[0]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue