Skip to content

Commit

Permalink
tries working around pywikibots unsufficient TimeoutError handling
Browse files Browse the repository at this point in the history
  • Loading branch information
WolfgangFahl committed Dec 24, 2021
1 parent f5f5774 commit 992a727
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion wikibot/smw.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import sys
from datetime import datetime
from urllib.parse import unquote
import pywikibot

class PrintRequest(object):
debug=False
Expand Down Expand Up @@ -588,7 +589,14 @@ def submit(self, parameters):
from pywikibot.data.api import Request

request=Request(site=self.site,parameters=parameters)
return request.submit()
result=None
try:
result=request.submit()
except pywikibot.exceptions.TimeoutError as _toe:
msg=f"submit for {self.site} failed due to pywikibot TimeoutError"
raise Exception(msg)
pass
return result

def info(self):
""" see https://www.semantic-mediawiki.org/wiki/Help:API:smwinfo"""
Expand Down

0 comments on commit 992a727

Please sign in to comment.