Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
daknuett committed Oct 6, 2023
1 parent 732acc2 commit 4099dbc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/gpt/core/io/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,18 @@ def load(fn, **p):
gpt.core.io.qlat_io,
]

if(not os.path.exists(fn)):
if not os.path.exists(fn):
raise FileNotFoundError(f"[Errno 2] No such file or directory: '{fn}'")

if(os.path.isfile(fn)):
if(not os.access(fn, os.R_OK)):
if os.path.isfile(fn):
if not os.access(fn, os.R_OK):
raise PermissionError(f"[Errno 13] Permission denied: '{fn}'")
if(os.path.isdir(fn)):
if os.path.isdir(fn):
# This part is for gpt's own format which uses directories
# instead of files.
if(not os.access(fn, os.X_OK)):
if not os.access(fn, os.X_OK):
raise PermissionError(f"[Errno 13] Permission denied: '{fn}'")
if(not os.access(fn, os.R_OK)):
if not os.access(fn, os.R_OK):
# Here, handling the access is a bit tricky:
# It is not necessary to have directory read access.

Check failure on line 73 in lib/gpt/core/io/load.py

View workflow job for this annotation

GitHub Actions / lint

W291:trailing whitespace
# But it is very likely that the individual files will lack
Expand Down

0 comments on commit 4099dbc

Please sign in to comment.