Xqt has submitted this change. (
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1358427?usp=email )
Change subject: mypy: fix mypy error in shell script
......................................................................
mypy: fix mypy error in shell script
Change-Id: I4f069b492005e56dd41793ae16ec76ca76ad4f95
---
M .pre-commit-config.yaml
M conftest.py
M pywikibot/scripts/shell.py
3 files changed, 9 insertions(+), 7 deletions(-)
Approvals:
Mahveotm: Looks good to me, approved
Xqt: Verified; Looks good to me, approved
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index ba1cdec..0abee10 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -136,7 +136,7 @@
families/[a-z][a-z\d]+_family|
page/(__init__|_decorators|_page|_revision|_user)|
pagegenerators/(__init__|_filters)|
- scripts/(?:i18n/)?__init__|
+ scripts/((?:i18n/)?__init__|shell)|
site/(__init__|_basesite|_decorators|_interwikimap|_tokenwallet|_upload)|
tools/(_deprecate|_logging|_unidata|chars|formatter|itertools)|
userinterfaces/(__init__|_interface_base|buffer_interface|terminal_interface|transliteration)
diff --git a/conftest.py b/conftest.py
index 36791a3..c8c60b6 100644
--- a/conftest.py
+++ b/conftest.py
@@ -46,7 +46,7 @@
r'families/[a-z][a-z\d]+_family|'
r'page/(__init__|_decorators|_page|_revision|_user)|'
r'pagegenerators/(__init__|_filters)|'
- r'scripts/(i18n/)?__init__|'
+ r'scripts/((i18n/)?__init__|shell)|'
r'site/(__init__|_basesite|_decorators|_interwikimap|'
r'_tokenwallet|_upload)|'
r'tools/(_deprecate|_logging|_unidata|chars|formatter|itertools)|'
diff --git a/pywikibot/scripts/shell.py b/pywikibot/scripts/shell.py
index 8e613a8..0a580c6 100755
--- a/pywikibot/scripts/shell.py
+++ b/pywikibot/scripts/shell.py
@@ -32,19 +32,21 @@
.. version-changed:: 8.2
*exitmsg* was added for :func:`code.interact`.
"""
- args = list(args)
+ arguments: list[str]
+
if '-noimport' in args:
- args.remove('-noimport')
+ arguments = list(args)
+ arguments.remove('-noimport')
env = None
warn_type = 'Ignoring'
else:
import pywikibot
- args = pywikibot.handle_args(args)
+ arguments = pywikibot.handle_args(args)
env = {'pywikibot': pywikibot}
warn_type = 'Unknown'
- if args:
- print(f'{warn_type} arguments: {", ".join(args)}\n') # noqa: T201
+ if arguments:
+ print(f'{warn_type} arguments: {", ".join(arguments)}\n') # noqa: T201
# Set up interactive features such as command history.
# This is defined in the site module of the Python Standard Library,
--
To view, visit
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1358427?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: I4f069b492005e56dd41793ae16ec76ca76ad4f95
Gerrit-Change-Number: 1358427
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: Mahveotm <[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]