Skip to content

Commit d1e2534

Browse files
committed
remove return from finally blocks
1 parent f4ddade commit d1e2534

4 files changed

Lines changed: 5 additions & 10 deletions

File tree

WrightTools/_dataset.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,7 @@ def natural_name(self):
148148
assert self._natural_name is not None
149149
except (AssertionError, AttributeError):
150150
self._natural_name = self.attrs["name"]
151-
finally:
152-
return self._natural_name
151+
return self._natural_name
153152

154153
@natural_name.setter
155154
def natural_name(self, value):

WrightTools/_group.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,7 @@ def natural_name(self):
237237
assert self._natural_name is not None
238238
except (AssertionError, AttributeError):
239239
self._natural_name = self.attrs["name"]
240-
finally:
241-
return self._natural_name
240+
return self._natural_name
242241

243242
@natural_name.setter
244243
def natural_name(self, value):

WrightTools/data/_axis.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,7 @@ def ndim(self) -> int:
120120
assert self._ndim is not None
121121
except (AssertionError, AttributeError):
122122
self._ndim = self.variables[0].ndim
123-
finally:
124-
return self._ndim
123+
return self._ndim
125124

126125
@property
127126
def points(self) -> np.ndarray:

WrightTools/data/_data.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,7 @@ def ndim(self) -> int:
166166
self._ndim = 0
167167
else:
168168
self._ndim = self.variables[0].ndim
169-
finally:
170-
return self._ndim
169+
return self._ndim
171170

172171
@property
173172
def shape(self) -> tuple:
@@ -176,8 +175,7 @@ def shape(self) -> tuple:
176175
assert self._shape is not None
177176
except (AssertionError, AttributeError):
178177
self._shape = wt_kit.joint_shape(*self.variables)
179-
finally:
180-
return self._shape
178+
return self._shape
181179

182180
@property
183181
def size(self) -> int:

0 commit comments

Comments
 (0)