jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/533244 )
Change subject: [IMPR] Enable inline comment prefixes with Python 3
......................................................................
[IMPR] Enable inline comment prefixes with Python 3
Inline comment prefixes where disabled with Python 3.2.
Enable it with ';' which is the same as in Python 2.
Note: Python 2 cannot set other inline comment prefixes
and has no keyword parameter inline_comment_prefixes.
Change-Id: I790ce04d6489f6004699c80a270f488b01351462
---
M pywikibot/bot.py
1 file changed, 5 insertions(+), 1 deletion(-)
Approvals:
D3r1ck01: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/bot.py b/pywikibot/bot.py
index 6dfb04d..d99b41a 100644
--- a/pywikibot/bot.py
+++ b/pywikibot/bot.py
@@ -1756,7 +1756,11 @@
def setOptions(self, **kwargs):
"""Read settings from scripts.ini file."""
- conf = configparser.ConfigParser()
+ if PY2:
+ conf = configparser.ConfigParser()
+ else:
+ conf = configparser.ConfigParser(inline_comment_prefixes=[';'])
+
section = calledModuleName()
if (conf.read(self.INI) == [self.INI] and conf.has_section(section)):
--
To view, visit https://gerrit.wikimedia.org/r/533244
To unsubscribe, or for help writing mail filters, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I790ce04d6489f6004699c80a270f488b01351462
Gerrit-Change-Number: 533244
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: D3r1ck01 <[email protected]>
Gerrit-Reviewer: jenkins-bot (75)
_______________________________________________
Pywikibot-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-commits