Skip to content

Commit 1bde5a4

Browse files
committed
Fix exception handling in topology_optimization.py
Signed-off-by: shbhmexe <[email protected]>
1 parent 4a7456a commit 1bde5a4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

SU2_PY/topology_optimization.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def obj_val(self, x):
123123
# clear previous output and run direct solver
124124
try:
125125
os.remove(self._objValFile)
126-
except OSError:
126+
except Exception:
127127
pass
128128

129129
try:
@@ -150,7 +150,7 @@ def obj_der(self, x):
150150
# clear previous output and run direct solver
151151
try:
152152
os.remove(self._objDerFile)
153-
except OSError:
153+
except Exception:
154154
pass
155155
N = x.shape[0]
156156
y = np.ndarray((N,))
@@ -200,7 +200,7 @@ def con_der(self, x):
200200
# clear previous output and run solver
201201
try:
202202
os.remove(self._conDerFile)
203-
except OSError:
203+
except Exception:
204204
pass
205205
N = x.shape[0]
206206
y = np.ndarray((N,))

0 commit comments

Comments
 (0)