Revision: 4340 Author: siebrand Date: 2007-09-21 13:40:33 +0000 (Fri, 21 Sep 2007)
Log Message: ----------- Handle exception ServerError
Modified Paths: -------------- trunk/pywikipedia/interwiki.py
Modified: trunk/pywikipedia/interwiki.py =================================================================== --- trunk/pywikipedia/interwiki.py 2007-09-21 09:41:33 UTC (rev 4339) +++ trunk/pywikipedia/interwiki.py 2007-09-21 13:40:33 UTC (rev 4340) @@ -1082,6 +1082,13 @@ wikipedia.output(u'Sleeping %i seconds before trying again.' % (timeout,)) timeout *= 2 time.sleep(timeout) + except wikipedia.ServerError: + if timeout>3600: + raise + wikipedia.output(u'ERROR putting page: ServerError.') + wikipedia.output(u'Sleeping %i seconds before trying again.' % (timeout,)) + timeout *= 2 + time.sleep(timeout) else: break if str(status) == '302':