jenkins-bot has submitted this change. (
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1155376?usp=email )
Change subject: IMPR: remove del statements from local scope
......................................................................
IMPR: remove del statements from local scope
Change-Id: I9f07af1b30222a160578c9ced018b50448791a9b
---
M scripts/category.py
M scripts/interwiki.py
M scripts/welcome.py
M tests/page_tests.py
4 files changed, 1 insertion(+), 8 deletions(-)
Approvals:
jenkins-bot: Verified
Xqt: Looks good to me, approved
diff --git a/scripts/category.py b/scripts/category.py
index 8098501..3004af4 100755
--- a/scripts/category.py
+++ b/scripts/category.py
@@ -368,7 +368,6 @@
self.cat_content_db = databases['cat_content_db']
# like the above, but for supercategories
self.superclass_db = databases['superclass_db']
- del databases
except Exception:
# If something goes wrong, just rebuild the database
self.rebuild()
@@ -1389,7 +1388,6 @@
result += ' ' + i18n.twtranslate(self.site, 'category-also-in',
{'alsocat': comma.join(
supercat_names)})
- del supercat_names
result += '\n'
if current_depth < self.max_depth:
for subcat in self.cat_db.get_subcats(cat):
diff --git a/scripts/interwiki.py b/scripts/interwiki.py
index 4eb6108..61bebbf 100755
--- a/scripts/interwiki.py
+++ b/scripts/interwiki.py
@@ -531,7 +531,6 @@
elif arg == 'skipfile':
skip_page_gen = pagegenerators.TextIOPageGenerator(value)
self.skip.update(skip_page_gen)
- del skip_page_gen
elif arg == 'neverlink':
self.neverlink += value.split(',')
elif arg == 'ignore':
@@ -540,7 +539,6 @@
elif arg == 'ignorefile':
ignore_page_gen = pagegenerators.TextIOPageGenerator(value)
self.ignore.update(ignore_page_gen)
- del ignore_page_gen
elif arg == 'showpage':
self.showtextlink += self.showtextlinkadd
elif arg == 'graph':
diff --git a/scripts/welcome.py b/scripts/welcome.py
index 5b544bd..b07e770 100755
--- a/scripts/welcome.py
+++ b/scripts/welcome.py
@@ -577,7 +577,6 @@
self.show_status(Msg.WARN)
pywikibot.info("The bad word page doesn't exist!")
self._blacklist = elenco + elenco_others + list_loaded
- del elenco, elenco_others, list_loaded
if not hasattr(self, '_whitelist') or force:
# initialize whitelist
@@ -599,7 +598,6 @@
# Join the whitelist words.
self._whitelist = list_white + whitelist_default
- del list_white, whitelist_default
with suppress(UnicodeEncodeError):
for wname in self._whitelist:
diff --git a/tests/page_tests.py b/tests/page_tests.py
index 0f58193..5a5c061 100755
--- a/tests/page_tests.py
+++ b/tests/page_tests.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
"""Tests for the page module."""
#
-# (C) Pywikibot team, 2008-2024
+# (C) Pywikibot team, 2008-2025
#
# Distributed under the terms of the MIT license.
#
@@ -875,7 +875,6 @@
page = pywikibot.Page(self.site, 'Pywikibot nobots test')
page.text = content
self.assertFalse(page.botMayEdit())
- del page
def test_real_page(self) -> None:
"""Test botMayEdit for real example due to T377651."""
--
To view, visit
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1155376?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.wikimedia.org/r/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I9f07af1b30222a160578c9ced018b50448791a9b
Gerrit-Change-Number: 1155376
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]