Skip to content

Commit 0ecd9f5

Browse files
committed
Remove unneeded else statements as pylint suggests
1 parent a534ba0 commit 0ecd9f5

File tree

6 files changed

+11
-19
lines changed

6 files changed

+11
-19
lines changed

webware/Examples/DBUtilsDemo.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,7 @@ def listSeminars(self):
200200
pass
201201
self.outputMsg(error, True)
202202
return
203-
else:
204-
self.outputMsg(f'Entries deleted: {len(ids)}')
203+
self.outputMsg(f'Entries deleted: {len(ids)}')
205204
db = self.connection()
206205
if not db:
207206
return
@@ -271,8 +270,7 @@ def listAttendees(self):
271270
db.rollback()
272271
self.outputMsg(error, True)
273272
return
274-
else:
275-
self.outputMsg(f'Entries deleted: {len(ids)}')
273+
self.outputMsg(f'Entries deleted: {len(ids)}')
276274
db = self.connection()
277275
if not db:
278276
return

webware/Examples/ExamplePage.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ def examplePages(self, plugInName=None):
5757
plugIn = self.application().plugIn(plugInName)
5858
except KeyError:
5959
return []
60-
else:
61-
return plugIn.examplePages()
60+
return plugIn.examplePages()
6261

6362
def writeSidebar(self):
6463
self.writeExamplesMenu()

webware/MiscUtils/DataTable.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,7 @@ def canReadExcel():
253253
Dispatch("Excel.Application")
254254
except Exception:
255255
return False
256-
else:
257-
return True
256+
return True
258257

259258
# endregion Functions
260259

webware/Servlet.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,9 @@ def runTransaction(transaction):
8181
# just a result of the first. Then you're stuck scratching your
8282
# head wondering what the first might have been.
8383
raise second from first
84-
else:
85-
# no problems with sleep() so raise the one and only exception
86-
raise
87-
else:
88-
transaction.sleep()
84+
# no problems with sleep() so raise the one and only exception
85+
raise
86+
transaction.sleep()
8987

9088
def runMethodForTransaction(self, transaction, method, *args, **kw):
9189
self.awake(transaction)

webware/SessionMemcachedStore.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,8 @@ def pop(self, key, default=NoDefault):
212212
value = self[key]
213213
except KeyError:
214214
return default
215-
else:
216-
del self[key]
217-
return value
215+
del self[key]
216+
return value
218217

219218
# endregion Access
220219

webware/SessionRedisStore.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,8 @@ def pop(self, key, default=NoDefault):
188188
value = self[key]
189189
except KeyError:
190190
return default
191-
else:
192-
del self[key]
193-
return value
191+
del self[key]
192+
return value
194193

195194
# endregion Access
196195

0 commit comments

Comments
 (0)