Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion niwidgets/exampledata.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
try:
# on >3 this ships by default
from pathlib import Path
except ModuleNotFoundError:
except ImportError:
# on 2.7 this should work
try:
from pathlib2 import Path
Expand Down
2 changes: 1 addition & 1 deletion niwidgets/niwidget_surface.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
try:
# on >3 this ships by default
from pathlib import Path
except ModuleNotFoundError:
except ImportError:
# on 2.7 this should work
try:
from pathlib2 import Path
Expand Down
9 changes: 4 additions & 5 deletions niwidgets/niwidget_volume.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
try:
# on >3 this ships by default
from pathlib import Path
except ModuleNotFoundError:
except ImportError:
# on 2.7 this should work
try:
from pathlib2 import Path
except ModuleNotFoundError:
raise ModuleNotFoundError('On python 2.7, niwidgets requires '
'pathlib2 to be installed.')
except ImportError:
raise ImportError('On python 2.7, niwidgets requires '
'pathlib2 to be installed.')


class NiftiWidget:
Expand All @@ -43,7 +43,6 @@ def __init__(self, filename):
if hasattr(filename, 'get_data'):
self.data = filename
else:
filename = Path(filename).resolve()
if not filename.is_file():
raise OSError('File ' + filename.name + ' not found.')

Expand Down