[MediaWiki-commits] [Gerrit] [FIX] upload: Increase stack depth of warnings - change (pywikibot/core)
XZise has uploaded a new change for review. https://gerrit.wikimedia.org/r/234924 Change subject: [FIX] upload: Increase stack depth of warnings .. [FIX] upload: Increase stack depth of warnings The `APISite.upload` method is decorated which causes an additional layer in the stack. This is increasing the depth of each warning accordingly. Change-Id: I0a2e04a7178600deaa040e002004eee886ca2c1c --- M pywikibot/site.py 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/24/234924/1 diff --git a/pywikibot/site.py b/pywikibot/site.py index 8cb66a8..e50e8ae 100644 --- a/pywikibot/site.py +++ b/pywikibot/site.py @@ -5274,7 +5274,7 @@ 'report_success is True or None', 'report_success=False or define ' 'ignore_warnings as callable/iterable', - 2) + 3) if isinstance(ignore_warnings, Iterable): ignored_warnings = ignore_warnings ignore_warnings = lambda warnings: all(w.code in ignored_warnings @@ -5426,12 +5426,12 @@ return False warn('When ignore_warnings=False in APISite.upload will change ' 'from raising an UploadWarning into behaving like being a ' - 'callable returning False.', DeprecationWarning, 2) + 'callable returning False.', DeprecationWarning, 3) if len(result['warnings']) 1: warn('The upload returned {0} warnings: ' '{1}'.format(len(result['warnings']), ', '.join(result['warnings'])), - UserWarning, 2) + UserWarning, 3) warning = list(result[warnings].keys())[0] message = result[warnings][warning] raise pywikibot.UploadWarning(warning, upload_warnings[warning] -- To view, visit https://gerrit.wikimedia.org/r/234924 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0a2e04a7178600deaa040e002004eee886ca2c1c Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: XZise commodorefabia...@gmx.de ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] [FIX] upload: Increase stack depth of warnings - change (pywikibot/core)
jenkins-bot has submitted this change and it was merged. Change subject: [FIX] upload: Increase stack depth of warnings .. [FIX] upload: Increase stack depth of warnings The `APISite.upload` method is decorated which causes an additional layer in the stack. This is increasing the depth of each warning accordingly. Change-Id: I0a2e04a7178600deaa040e002004eee886ca2c1c --- M pywikibot/site.py 1 file changed, 3 insertions(+), 3 deletions(-) Approvals: John Vandenberg: Looks good to me, approved jenkins-bot: Verified diff --git a/pywikibot/site.py b/pywikibot/site.py index 8cb66a8..e50e8ae 100644 --- a/pywikibot/site.py +++ b/pywikibot/site.py @@ -5274,7 +5274,7 @@ 'report_success is True or None', 'report_success=False or define ' 'ignore_warnings as callable/iterable', - 2) + 3) if isinstance(ignore_warnings, Iterable): ignored_warnings = ignore_warnings ignore_warnings = lambda warnings: all(w.code in ignored_warnings @@ -5426,12 +5426,12 @@ return False warn('When ignore_warnings=False in APISite.upload will change ' 'from raising an UploadWarning into behaving like being a ' - 'callable returning False.', DeprecationWarning, 2) + 'callable returning False.', DeprecationWarning, 3) if len(result['warnings']) 1: warn('The upload returned {0} warnings: ' '{1}'.format(len(result['warnings']), ', '.join(result['warnings'])), - UserWarning, 2) + UserWarning, 3) warning = list(result[warnings].keys())[0] message = result[warnings][warning] raise pywikibot.UploadWarning(warning, upload_warnings[warning] -- To view, visit https://gerrit.wikimedia.org/r/234924 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0a2e04a7178600deaa040e002004eee886ca2c1c Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: XZise commodorefabia...@gmx.de Gerrit-Reviewer: John Vandenberg jay...@gmail.com Gerrit-Reviewer: Ladsgroup ladsgr...@gmail.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits