jenkins-bot has submitted this change. ( 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1295706?usp=email )

Change subject: IMPR: use consistent quoting for invalid option messages in bot 
module
......................................................................

IMPR: use consistent quoting for invalid option messages in bot module

Change-Id: If25a24e63caf59e79c7f6e0a1728452648a3be4c
---
M pywikibot/bot.py
1 file changed, 3 insertions(+), 3 deletions(-)

Approvals:
  Matěj Suchánek: Looks good to me, approved
  jenkins-bot: Verified




diff --git a/pywikibot/bot.py b/pywikibot/bot.py
index d825d34..548ea3f 100644
--- a/pywikibot/bot.py
+++ b/pywikibot/bot.py
@@ -1008,7 +1008,7 @@
         super().__init__(options)

     def __missing__(self, key: str) -> None:
-        raise Error(f"'{key}' is not a valid option for {self._classname}.")
+        raise Error(f'{key!r} is not a valid option for {self._classname}.')

     def __getattr__(self, name: str) -> Any:
         """Get item from dict."""
@@ -1092,7 +1092,7 @@
         self.opt.update((opt, options[opt])
                         for opt in received_options & valid_options)
         for opt in received_options - valid_options:
-            _warning(f'{opt} is not a valid option. It was ignored.')
+            _warning(f'{opt!r} is not a valid option. It was ignored.')


 class BaseBot(OptionHandler):
@@ -1813,7 +1813,7 @@
                     method = getattr(conf, 'get' + value_type, default)
                 options[option] = method(section, option)
             for opt in set(conf.options(section)) - set(options):
-                _warning(f'"{opt}" is not a valid option. It was ignored.')
+                _warning(f'{opt!r} is not a valid option. It was ignored.')
             options.update(kwargs)
         else:
             options = kwargs

--
To view, visit 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1295706?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: If25a24e63caf59e79c7f6e0a1728452648a3be4c
Gerrit-Change-Number: 1295706
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: Matěj Suchánek <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to