jenkins-bot submitted this change.
[bugfix] Fix AttributeError on timeouts
Bug: T345023
Change-Id: I870ad9f45821a9f309d5f51ba5d80100a9573fd0
---
M pywikibot/data/__init__.py
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/pywikibot/data/__init__.py b/pywikibot/data/__init__.py
index 1dd0b02..53e3a1c 100644
--- a/pywikibot/data/__init__.py
+++ b/pywikibot/data/__init__.py
@@ -38,15 +38,15 @@
if not hasattr(self, 'retry_wait'):
self.retry_wait = pywikibot.config.retry_wait
- if self.current_retries > self.max_retries:
- raise pywikibot.exceptions.TimeoutError(
- 'Maximum retries attempted without success.')
-
if not hasattr(self, 'current_retries'):
self.current_retries = 1
else:
self.current_retries += 1
+ if self.current_retries > self.max_retries:
+ raise pywikibot.exceptions.TimeoutError(
+ 'Maximum retries attempted without success.')
+
# double the next wait, but do not exceed config.retry_max seconds
delay = delay or self.retry_wait
delay *= 2 ** (self.current_retries - 1)
To view, visit change 952520. To unsubscribe, or for help writing mail filters, visit settings.