Skip to content

Commit e1d78c8

Browse files
committed
resolve flake8
1 parent 185f82c commit e1d78c8

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

nibabel/filename_parser.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@
1616

1717
import pathlib
1818

19+
1920
class TypesFilenamesError(Exception):
2021
pass
2122

23+
2224
def _stringify_path(filepath_or_buffer):
2325
"""Attempt to convert a path-like object to a string.
2426
@@ -41,7 +43,7 @@ def _stringify_path(filepath_or_buffer):
4143
https://github.com/pandas-dev/pandas/blob/325dd686de1589c17731cf93b649ed5ccb5a99b4/pandas/io/common.py#L131-L160
4244
"""
4345
if hasattr(filepath_or_buffer, "__fspath__"):
44-
return filepath_or_buffer.__fspath__()
46+
return filepath_or_buffer.__fspath__()
4547
elif isinstance(filepath_or_buffer, pathlib.Path):
4648
return str(filepath_or_buffer)
4749
return filepath_or_buffer
@@ -288,7 +290,7 @@ def splitext_addext(filename,
288290
('fname', '.ext', '.foo')
289291
'''
290292
filename = _stringify_path(filename)
291-
293+
292294
if match_case:
293295
endswith = _endswith
294296
else:

nibabel/loadsave.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
from .deprecated import deprecate_with_version
2121

2222

23-
24-
2523
def load(filename, **kwargs):
2624
''' Load file given filename, guessing at file type
2725
@@ -39,14 +37,14 @@ def load(filename, **kwargs):
3937
'''
4038
filename = _stringify_path(filename)
4139

42-
#Check file exists and is not empty
40+
# Check file exists and is not empty
4341
try:
4442
stat_result = os.stat(filename)
4543
except OSError:
4644
raise FileNotFoundError("No such file or no access: '%s'" % filename)
4745
if stat_result.st_size <= 0:
4846
raise ImageFileError("Empty file: '%s'" % filename)
49-
47+
5048
sniff = None
5149
for image_klass in all_image_classes:
5250
is_valid, sniff = image_klass.path_maybe_image(filename, sniff)

0 commit comments

Comments
 (0)