summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2021-01-29 19:17:38 -0500
committerAkira TAGOH <akira@tagoh.org>2021-02-15 11:58:52 +0000
commit7bfbaecf819a8b1630dfc8f56126e31f985d5fb3 (patch)
tree34b294461f911a0c1b61d38c798c6971785b5b00
parent401d521c1f68ce16c1fa62caf307a1869ba63c48 (diff)
Windows: Fix symlink privilege error detection
The message is in e.args[1] and not e.args[0] at least with python 3.8. Should be more future proof like this in case it change again.
-rw-r--r--conf.d/link_confs.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/conf.d/link_confs.py b/conf.d/link_confs.py
index 0c42efb..5a78d8d 100644
--- a/conf.d/link_confs.py
+++ b/conf.d/link_confs.py
@@ -3,6 +3,7 @@
import os
import sys
import argparse
+import platform
if __name__=='__main__':
parser = argparse.ArgumentParser()
@@ -26,7 +27,7 @@ if __name__=='__main__':
break
except OSError as e:
# Symlink privileges are not available
- if len(e.args) == 1 and 'privilege' in e.args[0]:
+ if platform.system().lower() == 'windows' and e.winerror == 1314:
break
raise
except FileExistsError: