jenkins-bot submitted this change.
[cleanup] ignore legacy throttle format.
throttle format was changed with Pywikibot 6.2.0 (5f4d5fb).
Remove this legacy detection and just ignore wrong lines.
Change-Id: Ic4c603f74de8d6657dab80af38d7e2abc65874f5
---
M pywikibot/throttle.py
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/pywikibot/throttle.py b/pywikibot/throttle.py
index adb107a..0404497 100644
--- a/pywikibot/throttle.py
+++ b/pywikibot/throttle.py
@@ -111,20 +111,16 @@
return
for line in lines:
- # parse line; format is "pid timestamp site"
+ # parse line; format is "module_id pid timestamp site"
try:
- items = line.split(' ')
- if len(items) == 3: # read legacy format
- _id, _pid, _time, _site = self._module_hash(), *items
- else:
- _id, _pid, _time, _site = items
+ _id, _pid, _time, _site = line.split(' ')
proc_entry = ProcEntry(
module_id=_id,
pid=int(_pid),
time=int(float(_time)),
site=_site.rstrip()
)
- except (IndexError, ValueError):
+ except (IndexError, ValueError): # pragma: no cover
# Sometimes the file gets corrupted ignore that line
continue
yield proc_entry
To view, visit change 850152. To unsubscribe, or for help writing mail filters, visit settings.