Revision: 4097
Author: btongminh
Date: 2007-08-23 14:29:17 +0000 (Thu, 23 Aug 2007)
Log Message:
-----------
Handle server downage better.
Modified Paths:
--------------
trunk/pywikipedia/checkusage.py
Modified: trunk/pywikipedia/checkusage.py
===================================================================
--- trunk/pywikipedia/checkusage.py 2007-08-23 14:17:57 UTC (rev 4096)
+++ trunk/pywikipedia/checkusage.py 2007-08-23 14:29:17 UTC (rev 4097)
@@ -98,7 +98,11 @@
headers['Connection'] = 'Keep-Alive'
headers['User-Agent'] = 'MwClient/' + __ver__
- self._conn.request(method, path, data, headers)
+ try:
+ self._conn.request(method, path, data, headers)
+ except socket.error, e:
+ self._conn.close()
+ raise
try:
res = self._conn.getresponse()
Show replies by date