Skip to content

Commit 7e38429

Browse files
committed
Clean up import exception usage
1 parent 739f5f4 commit 7e38429

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

src/sst/elements/merlin/tests/testsuite_default_merlin.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55

66
try:
77
from sympy.polys.domains import ZZ
8-
except:
8+
except ImportError:
99
pass
1010
try:
1111
from sympy.polys.galoistools import (gf_irreducible_p, gf_add, gf_mul, gf_rem)
12-
except:
12+
except ImportError:
1313
pass
1414

1515
################################################################################

src/sst/elements/merlin/topology/pymerlin-topo-polarfly.py

+5-8
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,16 @@
1818

1919
try:
2020
from sympy.polys.domains import ZZ
21-
except:
21+
except ImportError:
2222
pass
23-
#print('--> MODULE NOT FOUND: sympy.polys.domains')
2423
try:
2524
from sympy.polys.galoistools import (gf_irreducible_p, gf_add, gf_mul, gf_rem)
26-
except:
25+
except ImportError:
2726
pass
28-
#print('--> MODULE NOT FOUND: sympy.polys.galoistools')
2927
try:
3028
import networkx as nx
31-
except:
29+
except ImportError:
3230
pass
33-
#print('--> MODULE NOT FOUND: networkx')
3431

3532

3633
#############################################
@@ -41,10 +38,10 @@ class GF():
4138
def __init__(self, pp):
4239

4340
if not ('sympy.polys.galoistools' in sys.modules):
44-
raise Exception('--> Did not load Sympy Polys Galoistools : module required for field construction')
41+
raise ImportError('--> Did not load Sympy Polys Galoistools : module required for field construction')
4542

4643
if not ('sympy.polys.domains' in sys.modules):
47-
raise Exception('--> Did not load Sympy Polys Domains : module required for field construction')
44+
raise ImportError('--> Did not load Sympy Polys Domains : module required for field construction')
4845

4946

5047
self.pp = int(pp)

src/sst/elements/merlin/topology/pymerlin-topo-polarstar.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@
1717

1818
try:
1919
import networkx as nx
20-
except:
20+
except ImportError:
2121
pass
22-
#print('--> MODULE NOT FOUND: networkx')
2322

2423
def isPowerOfPrime(num):
2524
if (num<2):

0 commit comments

Comments
 (0)