do not use bare except

This commit is contained in:
Martin Diehl 2019-12-07 20:15:50 +01:00
parent c6c77b64d2
commit b92cfbbd5b
3 changed files with 11 additions and 9 deletions

View File

@ -65,9 +65,10 @@ for i in range(len(options.formulas)):
if filenames == []: filenames = [None] if filenames == []: filenames = [None]
for name in filenames: for name in filenames:
try: table = damask.ASCIItable(name = name, try:
buffered = False) table = damask.ASCIItable(name = name, buffered = False)
except: continue except IOError:
continue
damask.util.report(scriptName,name) damask.util.report(scriptName,name)
# ------------------------------------------ read header ------------------------------------------- # ------------------------------------------ read header -------------------------------------------

View File

@ -41,9 +41,9 @@ if filenames == []: filenames = [None]
for name in filenames: for name in filenames:
try: try:
table = damask.ASCIItable(name = name, table = damask.ASCIItable(name = name, buffered = False)
buffered = False) except IOError:
except IOError: continue continue
damask.util.report(scriptName,name) damask.util.report(scriptName,name)
# ------------------------------------------ read header ------------------------------------------ # ------------------------------------------ read header ------------------------------------------

View File

@ -125,9 +125,10 @@ R = damask.Rotation.fromAxisAngle(np.array(options.labrotation),options.degrees,
if filenames == []: filenames = [None] if filenames == []: filenames = [None]
for name in filenames: for name in filenames:
try: table = damask.ASCIItable(name = name, try:
buffered = False) table = damask.ASCIItable(name = name, buffered = False)
except Exception: continue except IOError:
continue
damask.util.report(scriptName,name) damask.util.report(scriptName,name)
# ------------------------------------------ read header ------------------------------------------ # ------------------------------------------ read header ------------------------------------------