Skip to content

Commit 8bfd797

Browse files
committed
MAINT: fix except blocks without defined exceptions
1 parent a7b94a7 commit 8bfd797

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

rocketpy/Function.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1556,7 +1556,7 @@ def __truediv__(self, other):
15561556
else:
15571557
return Function(lambda x: (self.getValueOpt2(x) / other(x)))
15581558
# If other is Float except...
1559-
except:
1559+
except AttributeError:
15601560
if isinstance(other, (float, int, complex)):
15611561
# Check if Function object source is array or callable
15621562
if isinstance(self.source, np.ndarray):
@@ -1658,7 +1658,7 @@ def __pow__(self, other):
16581658
else:
16591659
return Function(lambda x: (self.getValueOpt2(x) ** other(x)))
16601660
# If other is Float except...
1661-
except:
1661+
except AttributeError:
16621662
if isinstance(other, (float, int, complex)):
16631663
# Check if Function object source is array or callable
16641664
if isinstance(self.source, np.ndarray):
@@ -1760,7 +1760,7 @@ def __mul__(self, other):
17601760
else:
17611761
return Function(lambda x: (self.getValue(x) * other(x)))
17621762
# If other is Float except...
1763-
except:
1763+
except AttributeError:
17641764
if isinstance(other, (float, int, complex)):
17651765
# Check if Function object source is array or callable
17661766
if isinstance(self.source, np.ndarray):
@@ -1862,7 +1862,7 @@ def __add__(self, other):
18621862
else:
18631863
return Function(lambda x: (self.getValue(x) + other(x)))
18641864
# If other is Float except...
1865-
except:
1865+
except AttributeError:
18661866
if isinstance(other, (float, int, complex)):
18671867
# Check if Function object source is array or callable
18681868
if isinstance(self.source, np.ndarray):
@@ -1964,7 +1964,7 @@ def __sub__(self, other):
19641964
else:
19651965
return Function(lambda x: (self.getValue(x) * other(x)))
19661966
# If other is Float except...
1967-
except:
1967+
except AttributeError:
19681968
if isinstance(other, (float, int, complex)):
19691969
# Check if Function object source is array or callable
19701970
if isinstance(self.source, np.ndarray):

0 commit comments

Comments
 (0)