Skip to content

Commit d98dfe9

Browse files
committed
error handling
1 parent d3cb8b3 commit d98dfe9

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

torch_scatter/__init__.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,12 @@
1212
torch.ops.load_library(importlib.machinery.PathFinder().find_spec(
1313
library, [osp.dirname(__file__)]).origin)
1414
except OSError as e:
15-
if 'undefined symbol' in str(e):
16-
major, minor = [int(x) for x in torch.__version__.split('.')[:2]]
17-
t_major, t_minor = expected_torch_version
18-
if major != t_major or (major == t_major and minor != t_minor):
19-
raise RuntimeError(
20-
f'Expected PyTorch version {t_major}.{t_minor} but found '
21-
f'version {major}.{minor}.')
15+
major, minor = [int(x) for x in torch.__version__.split('.')[:2]]
16+
t_major, t_minor = expected_torch_version
17+
if major != t_major or (major == t_major and minor != t_minor):
18+
raise RuntimeError(
19+
f'Expected PyTorch version {t_major}.{t_minor} but found '
20+
f'version {major}.{minor}.')
2221
raise OSError(e)
2322
except AttributeError as e:
2423
if os.getenv('BUILD_DOCS', '0') != '1':

0 commit comments

Comments
 (0)