File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 1616
1717import pathlib
1818
19+
1920class TypesFilenamesError (Exception ):
2021 pass
2122
23+
2224def _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 :
Original file line number Diff line number Diff line change 2020from .deprecated import deprecate_with_version
2121
2222
23-
24-
2523def 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 )
You can’t perform that action at this time.
0 commit comments