jenkins-bot has submitted this change and it was merged.
Change subject: [FIX] Use explicit indexes for str.format ......................................................................
[FIX] Use explicit indexes for str.format
In Python 2.6 the str.format must use explicit indexes when using str.format. For example '{}'.format(42) would be valid in Python 2.7 or newer but in Python 2.6 the index must be set: '{0}'.format(42)
Change-Id: Iace1bbf1200f2fe1f4e392c45c060c4838858bef --- M pywikibot/diff.py M pywikibot/page.py 2 files changed, 5 insertions(+), 5 deletions(-)
Approvals: John Vandenberg: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/diff.py b/pywikibot/diff.py index 6e0e38b..015dcbd 100644 --- a/pywikibot/diff.py +++ b/pywikibot/diff.py @@ -334,21 +334,21 @@
""" patch = PatchManager(oldtext, newtext, n=n, by_letter=by_letter) - pywikibot.output('\03{{lightpurple}}\n{:*^50}\03{{default}}\n'.format(' ALL CHANGES ')) + pywikibot.output('\03{{lightpurple}}\n{0:*^50}\03{{default}}\n'.format(' ALL CHANGES '))
for hunk in patch.hunks: pywikibot.output(hunk.diff_text) - pywikibot.output('\03{{lightpurple}}\n{:*^50}\03{{default}}\n'.format(' REVIEW CHANGES ')) + pywikibot.output('\03{{lightpurple}}\n{0:*^50}\03{{default}}\n'.format(' REVIEW CHANGES '))
text_list = patch.apply() - pywikibot.output('\03{{lightpurple}}\n{:*^50}\03{{default}}\n'.format(' APPROVED CHANGES ')) + pywikibot.output('\03{{lightpurple}}\n{0:*^50}\03{{default}}\n'.format(' APPROVED CHANGES '))
if any(hunk.reviewed == hunk.APPR for hunk in patch.hunks): for hunk in patch.hunks: if hunk.reviewed == hunk.APPR: pywikibot.output(hunk.diff_text) else: - pywikibot.output('\03{{lightpurple}}{:^50}\03{{default}}'.format('None.')) + pywikibot.output('\03{{lightpurple}}{0:^50}\03{{default}}'.format('None.'))
text = ''.join(text_list)
diff --git a/pywikibot/page.py b/pywikibot/page.py index 181da10..bd98c0c 100644 --- a/pywikibot/page.py +++ b/pywikibot/page.py @@ -4872,7 +4872,7 @@ if unicodeCodepoint and unicodeCodepoint not in ignore: if unicodeCodepoint > sys.maxunicode: # solve narrow Python 2 build exception (UTF-16) - return eval("'\U{:08x}'".format(unicodeCodepoint)) + return eval("'\U{0:08x}'".format(unicodeCodepoint)) else: return chr(unicodeCodepoint) else:
pywikibot-commits@lists.wikimedia.org