mirror of
https://github.com/wassname/ray.git
synced 2026-06-27 22:53:20 +08:00
Fixing Python2 compatibility issues. Adding inline docs (#3656)
This commit is contained in:
committed by
Robert Nishihara
parent
aad3c50e2d
commit
eb1e5fa2cf
@@ -66,8 +66,16 @@ def try_to_create_directory(directory_path):
|
||||
# important when multiple people are using the same machine.
|
||||
try:
|
||||
os.chmod(directory_path, 0o0777)
|
||||
except PermissionError:
|
||||
pass
|
||||
except OSError as e:
|
||||
# Silently suppress the PermissionError that is thrown by the chmod.
|
||||
# This is done because the user attempting to change the permissions
|
||||
# on a directory may not own it. The chmod is attempted whether the
|
||||
# directory is new or not to avoid race conditions.
|
||||
# ray-project/ray/#3591
|
||||
if e.errno in [errno.EACCES, errno.EPERM]:
|
||||
pass
|
||||
else:
|
||||
raise
|
||||
|
||||
|
||||
def get_temp_root():
|
||||
|
||||
Reference in New Issue
Block a user