summaryrefslogtreecommitdiff
path: root/tools/util.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/util.py')
-rw-r--r--tools/util.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/util.py b/tools/util.py
index 8b8628aba..8a65f2ede 100644
--- a/tools/util.py
+++ b/tools/util.py
@@ -36,6 +36,10 @@ def symlink(target, name, target_is_dir=False):
CreateSymbolicLinkW.argtypes = (ctypes.c_wchar_p, ctypes.c_wchar_p,
ctypes.c_uint32)
+ # Replace forward slashes by backward slashes.
+ # Strangely it seems that this is only necessary for symlinks to files.
+ # Forward slashes don't cause any issues when the target is a directory.
+ target = target.replace("/", "\\")
flags = 0x02 # SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE
if (target_is_dir):
flags |= 0x01 # SYMBOLIC_LINK_FLAG_DIRECTORY