Skip to content

Commit 7f1934f

Browse files
authored
style: Fix R1711: Useless return at end of function or method (useless-return) (OSGeo#4892)
1 parent b2b2f93 commit 7f1934f

File tree

8 files changed

+5
-11
lines changed

8 files changed

+5
-11
lines changed

gui/wxpython/animation/anim.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,11 @@ def SetCallbackOrientationChanged(self, callback):
9393

9494
def Start(self):
9595
if not self.IsActive():
96-
return
96+
pass
9797

9898
def Pause(self, paused):
9999
if not self.IsActive():
100-
return
100+
pass
101101

102102
def Stop(self):
103103
if not self.IsActive():

gui/wxpython/animation/controller.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,6 @@ def export_avi_callback(event):
627627
del self.busy
628628
if error:
629629
GError(parent=self.frame, message=error)
630-
return
631630

632631
if exportInfo["method"] == "sequence":
633632
filename = os.path.join(

gui/wxpython/photo2image/ip2i_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1145,7 +1145,7 @@ def OnGeorectDone(self, **kargs):
11451145
"""Print final message"""
11461146
global maptype
11471147
if maptype == "raster":
1148-
return
1148+
pass
11491149

11501150
def OnSettings(self, event):
11511151
"""GCP Manager settings"""

gui/wxpython/rdigit/dialogs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def OnBackgroundMap(self, event):
9191
ret = grast.raster_info(value)
9292
self._typeChoice.SetStringSelection(ret["datatype"])
9393
except CalledModuleError:
94-
return
94+
pass
9595

9696
def OnOK(self, event):
9797
mapName = self.GetMapName()

gui/wxpython/rdigit/toolbars.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ def _cellValueChanged(self):
207207
value = float(value)
208208
self._controller.SetCellValue(value)
209209
except ValueError:
210-
return
210+
pass
211211

212212
def _widthValueChanged(self):
213213
value = self._widthValue.GetValue()
@@ -216,7 +216,6 @@ def _widthValueChanged(self):
216216
self._controller.SetWidthValue(value)
217217
except ValueError:
218218
self._controller.SetWidthValue(0)
219-
return
220219

221220
def _changeDrawColor(self):
222221
color = self._color.GetColour()

gui/wxpython/rlisetup/wizard.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -756,7 +756,6 @@ def OnExitPage(self, event: WizardEvent | None = None) -> None:
756756
elif self.region == "draw":
757757
self.SetNext(self.parent.drawsampleframepage)
758758
self.parent.samplingareapage.SetPrev(self.parent.drawsampleframepage)
759-
return
760759

761760

762761
class KeyboardPage(TitledPage):

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,6 @@ disable = [
635635
"R1704", # Redefining argument with the local name %r (redefined-argument-from-local)
636636
"R1705", # Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return)
637637
"R1710", # Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements)
638-
"R1711", # Useless return at end of function or method (useless-return)
639638
"R1712", # Consider using tuple unpacking for swapping variables (consider-swap-variables)
640639
"R1713", # Consider using str.join(sequence) for concatenating strings from an iterable (consider-using-join)
641640
"R1714", # Consider merging these comparisons with 'in' by using '%s %sin (%s)'. Use a set instead if elements are hashable. (consider-using-in)

python/grass/pygrass/vector/geometry.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,8 +1134,6 @@ def from_wkt(self, wkt):
11341134
self.reset()
11351135
for coord in match.groups()[0].strip().split(","):
11361136
self.append(tuple(float(e) for e in coord.split(" ")))
1137-
else:
1138-
return None
11391137

11401138
def buffer(
11411139
self,

0 commit comments

Comments
 (0)