##// END OF EJS Templates
py3: catch PermissionError instead of checking errno == EACCES
Manuel Jacob -
r50202:6f2a57ba default
parent child Browse files
Show More
@@ -302,18 +302,13 b' def checklink(path):'
302 302 try:
303 303 fullpath = os.path.join(cachedir, target)
304 304 open(fullpath, b'w').close()
305 except IOError as inst:
306 # pytype: disable=unsupported-operands
307 if inst[0] == errno.EACCES:
308 # pytype: enable=unsupported-operands
309
305 except PermissionError:
310 306 # If we can't write to cachedir, just pretend
311 307 # that the fs is readonly and by association
312 308 # that the fs won't support symlinks. This
313 309 # seems like the least dangerous way to avoid
314 310 # data loss.
315 311 return False
316 raise
317 312 try:
318 313 os.symlink(target, name)
319 314 if cachedir is None:
General Comments 0
You need to be logged in to leave comments. Login now