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.
This commit is contained in:
parent
401d521c1f
commit
7bfbaecf81
|
@ -3,6 +3,7 @@
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import argparse
|
import argparse
|
||||||
|
import platform
|
||||||
|
|
||||||
if __name__=='__main__':
|
if __name__=='__main__':
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
|
@ -26,7 +27,7 @@ if __name__=='__main__':
|
||||||
break
|
break
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
# Symlink privileges are not available
|
# 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
|
break
|
||||||
raise
|
raise
|
||||||
except FileExistsError:
|
except FileExistsError:
|
||||||
|
|
Loading…
Reference in New Issue