jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/807485 )
Change subject: [IMPR] Simplify final throttle.drop() call ......................................................................
[IMPR] Simplify final throttle.drop() call
use popitem() to get any Site instead creating a list of all values
Change-Id: Ic89ef54ab3ad182208d1779442e9c7720c9286f5 --- M pywikibot/__init__.py 1 file changed, 2 insertions(+), 2 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/__init__.py b/pywikibot/__init__.py index 8954930..65de1f7 100644 --- a/pywikibot/__init__.py +++ b/pywikibot/__init__.py @@ -1345,8 +1345,8 @@ page_put_queue.not_full.notify_all()
# only need one drop() call because all throttles use the same global pid - with suppress(IndexError): - list(_sites.values())[0].throttle.drop() + with suppress(KeyError): + _sites.popitem()[1].throttle.drop() log('Dropped throttle(s).')