jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/998293?usp=email )
Change subject: [bugfix] use flake8-bugbear >= 24.2.6 to ignore B038 tests ......................................................................
[bugfix] use flake8-bugbear >= 24.2.6 to ignore B038 tests
Bug: T355372 Change-Id: Ib6d0acd8473008652f6f1f9d914ee8673972e625 --- M pywikibot/data/api/__init__.py M pywikibot/proofreadpage.py M scripts/dataextend.py M setup.py 4 files changed, 15 insertions(+), 12 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/data/api/__init__.py b/pywikibot/data/api/__init__.py index 609d3c5..c647567 100644 --- a/pywikibot/data/api/__init__.py +++ b/pywikibot/data/api/__init__.py @@ -57,10 +57,7 @@ if isinstance(family, SubdomainFamily): for cookie in http.cookie_jar: if family.domain == cookie.domain: - # ignore B038: iterating over cookies already uses a list, - # created in cookiejar.deepvalues() - http.cookie_jar.clear( # noqa: B038 - cookie.domain, cookie.path, cookie.name) + http.cookie_jar.clear(cookie.domain, cookie.path, cookie.name)
# Bug: T113120, T228841 diff --git a/pywikibot/proofreadpage.py b/pywikibot/proofreadpage.py index 8050443..2df5eb1 100644 --- a/pywikibot/proofreadpage.py +++ b/pywikibot/proofreadpage.py @@ -543,8 +543,7 @@ if self._num is not None: for page in what_links_here: if page.title(with_ns=False) == self._base: - # ignore B038, we break the loop after removal - what_links_here.remove(page) # noqa: B038 + what_links_here.remove(page) self._index = (page, what_links_here) break
diff --git a/scripts/dataextend.py b/scripts/dataextend.py index 51e8e1c..3d6da3e 100755 --- a/scripts/dataextend.py +++ b/scripts/dataextend.py @@ -967,9 +967,7 @@ claim[0]])].addSources(sourcedata) else: if claim[0] not in propsdone: - # DequeGenerator is intended to add items - # during generation, therefore ignore B038 - propstodo.append(claim[0]) # noqa: B038 + propstodo.append(claim[0])
createdclaim = pywikibot.Claim(self.site, claim[0])
@@ -1095,8 +1093,7 @@ 0]])].addSources(sourcedata) except AttributeError: if prop not in propsdone: - # ignore B038 due to DequeGenerator - propstodo.append(prop) # noqa: B038 + propstodo.append(prop) pywikibot.info('Sourcing failed')
for language, description in analyzer.getdescriptions(): diff --git a/setup.py b/setup.py index 4d3e204..3aa0946 100755 --- a/setup.py +++ b/setup.py @@ -59,7 +59,7 @@ 'flake8>=5.0.4', 'darglint2', 'pydocstyle>=6.3.0', - 'flake8-bugbear>=23.3.12', + 'flake8-bugbear!=24.1.17', 'flake8-comprehensions>=3.13.0', 'flake8-docstrings>=1.4.0', 'flake8-future-annotations',