##// 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 try:
302 try:
303 fullpath = os.path.join(cachedir, target)
303 fullpath = os.path.join(cachedir, target)
304 open(fullpath, b'w').close()
304 open(fullpath, b'w').close()
305 except IOError as inst:
305 except PermissionError:
306 # pytype: disable=unsupported-operands
306 # If we can't write to cachedir, just pretend
307 if inst[0] == errno.EACCES:
307 # that the fs is readonly and by association
308 # pytype: enable=unsupported-operands
308 # that the fs won't support symlinks. This
309
309 # seems like the least dangerous way to avoid
310 # If we can't write to cachedir, just pretend
310 # data loss.
311 # that the fs is readonly and by association
311 return False
312 # that the fs won't support symlinks. This
313 # seems like the least dangerous way to avoid
314 # data loss.
315 return False
316 raise
317 try:
312 try:
318 os.symlink(target, name)
313 os.symlink(target, name)
319 if cachedir is None:
314 if cachedir is None:
General Comments 0
You need to be logged in to leave comments. Login now