FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Simplify some code · robquant/python-webuntis@38f5588 · GitHub

Commit 38f5588

Browse files
committed
Simplify some code
1 parent 871e407 commit 38f5588

2 files changed

Lines changed: 2 additions & 8 deletions

File tree

‎webuntis/session.py‎

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -377,12 +377,6 @@ class Session(JSONRPCSession, ResultWrapperMixin):
377377
initialization.'''
378378

379379
def __init__(self, **config):
380-
try:
381-
cachelen = config['cachelen']
382-
del config['cachelen']
383-
except KeyError:
384-
cachelen = 20
385-
380+
cachelen = config.pop('cachelen', 20)
386381
self.cache = utils.SessionCache(maxlen=cachelen)
387-
388382
JSONRPCSession.__init__(self, **config)

‎webuntis/utils/misc.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def clear(self, method=None):
4646
if method is None:
4747
LruDict.clear(self)
4848
else:
49-
for k in list(self):
49+
for k in self:
5050
if k[0] == method:
5151
del self[k]
5252

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL