jenkins-bot has submitted this change and it was merged.
Change subject: Fix UnboundLocalError
......................................................................
Fix UnboundLocalError
In python3 there may be UnboundLocalError in case of exception during save
Change-Id: I8ae74d00b63bc20b2eed511687a4feb3bc2e58ca
---
M pywikibot/page.py
1 file changed, 2 insertions(+), 1 deletion(-)
Approvals:
XZise: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/page.py b/pywikibot/page.py
index e089fc2..5f58dee 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -1057,7 +1057,8 @@
else:
pywikibot.output(u"Page %s saved" % link)
# TODO: other "expected" error types to catch?
- except pywikibot.Error as err:
+ except pywikibot.Error as edit_err:
+ err = edit_err # edit_err will be deleted in the end of the scope
pywikibot.log(u"Error saving page %s (%s)\n" % (link, err),
exc_info=True)
if not callback and not async:
--
To view, visit
https://gerrit.wikimedia.org/r/206356
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I8ae74d00b63bc20b2eed511687a4feb3bc2e58ca
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Eranroz <eranroz89(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: jenkins-bot <>