mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-03-16 22:10:26 +00:00
Avoid FileNotFoundError if FILENAME does not exist
File ".../linkcheck/fileutil.py", line 110, in is_valid_config_source
return os.path.isfile(filename) or stat.S_ISFIFO(os.stat(filename).st_mode)
^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory
This commit is contained in:
parent
eeee80ec4f
commit
7a3be9ba93
1 changed files with 2 additions and 1 deletions
|
|
@ -107,4 +107,5 @@ def is_writable_by_others(filename):
|
|||
|
||||
def is_valid_config_source(filename):
|
||||
"""Check if the file is a valid config file."""
|
||||
return os.path.isfile(filename) or stat.S_ISFIFO(os.stat(filename).st_mode)
|
||||
return os.path.exists(filename) and (
|
||||
os.path.isfile(filename) or stat.S_ISFIFO(os.stat(filename).st_mode))
|
||||
|
|
|
|||
Loading…
Reference in a new issue