File tree Expand file tree Collapse file tree 2 files changed +3
-11
lines changed Expand file tree Collapse file tree 2 files changed +3
-11
lines changed Original file line number Diff line number Diff line change 24
24
25
25
from itertools import zip_longest
26
26
27
- try :
28
- from contextlib import nullcontext
29
- except ImportError : # PY36
30
- from contextlib import contextmanager
31
- @contextmanager
32
- def nullcontext ():
33
- yield
27
+ from contextlib import nullcontext
34
28
35
29
36
30
def test_data (subdir = None , fname = None ):
Original file line number Diff line number Diff line change @@ -36,8 +36,7 @@ def test_read_img_data():
36
36
]
37
37
fnames_test += [pathlib .Path (p ) for p in fnames_test ]
38
38
for fname in fnames_test :
39
- # os.path.join doesn't work between str / os.PathLike in py3.5
40
- fpath = pjoin (data_path , str (fname ))
39
+ fpath = pjoin (data_path , fname )
41
40
if isinstance (fname , pathlib .Path ):
42
41
fpath = pathlib .Path (fpath )
43
42
img = load (fpath )
@@ -56,8 +55,7 @@ def test_read_img_data():
56
55
up_fpath = pjoin (tmpdir , str (fname ).upper ())
57
56
if isinstance (fname , pathlib .Path ):
58
57
up_fpath = pathlib .Path (up_fpath )
59
- # shutil doesn't work with os.PathLike in py3.5
60
- shutil .copyfile (str (fpath ), str (up_fpath ))
58
+ shutil .copyfile (fpath , up_fpath )
61
59
img = load (up_fpath )
62
60
assert_array_equal (img .dataobj , data )
63
61
del img
You can’t perform that action at this time.
0 commit comments