This commit is contained in:
Bastian Kleineidam 2013-06-27 22:23:52 +02:00
parent 2540051edd
commit cf3472b5ef
1 changed files with 3 additions and 3 deletions

View File

@ -36,10 +36,10 @@ except ImportError:
of os.environ.get("PATH"), or can be overridden with a custom search of os.environ.get("PATH"), or can be overridden with a custom search
path. path.
""" """
# Check that a given file can be accessed with the correct mode.
# Additionally check that `file` is not a directory, as on Windows
# directories pass the os.access check.
def _access_check(fn, mode): def _access_check(fn, mode):
"""Check that a given file can be accessed with the correct mode.
Additionally check that `fn` is not a directory, as on Windows
directories pass the os.access check."""
return (os.path.exists(fn) and os.access(fn, mode) return (os.path.exists(fn) and os.access(fn, mode)
and not os.path.isdir(fn)) and not os.path.isdir(fn))
# If we're given a path with a directory part, look it up directly rather # If we're given a path with a directory part, look it up directly rather