Skip to content

Commit

Permalink
Clean up import exception usage
Browse files Browse the repository at this point in the history
  • Loading branch information
berquist committed Oct 16, 2023
1 parent 20b6fa3 commit cdd0225
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/sst/elements/merlin/tests/testsuite_default_merlin.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

try:
from sympy.polys.domains import ZZ
except:
except ImportError:
pass
try:
from sympy.polys.galoistools import (gf_irreducible_p, gf_add, gf_mul, gf_rem)
except:
except ImportError:
pass

################################################################################
Expand Down
13 changes: 5 additions & 8 deletions src/sst/elements/merlin/topology/pymerlin-topo-polarfly.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,16 @@

try:
from sympy.polys.domains import ZZ
except:
except ImportError:
pass
#print('--> MODULE NOT FOUND: sympy.polys.domains')
try:
from sympy.polys.galoistools import (gf_irreducible_p, gf_add, gf_mul, gf_rem)
except:
except ImportError:
pass
#print('--> MODULE NOT FOUND: sympy.polys.galoistools')
try:
import networkx as nx
except:
except ImportError:
pass
#print('--> MODULE NOT FOUND: networkx')


#############################################
Expand All @@ -41,10 +38,10 @@ class GF():
def __init__(self, pp):

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

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


self.pp = int(pp)
Expand Down
3 changes: 1 addition & 2 deletions src/sst/elements/merlin/topology/pymerlin-topo-polarstar.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@

try:
import networkx as nx
except:
except ImportError:
pass
#print('--> MODULE NOT FOUND: networkx')

def isPowerOfPrime(num):
if (num<2):
Expand Down

0 comments on commit cdd0225

Please sign in to comment.