[Pywikipedia-l] SVN: [5315] trunk/pywikipedia/commonsdelinker/checkusage.py

btongminh at svn.wikimedia.org btongminh at svn.wikimedia.org
Tue May 6 10:38:43 UTC 2008


Revision: 5315
Author:   btongminh
Date:     2008-05-06 10:38:43 +0000 (Tue, 06 May 2008)

Log Message:
-----------
Fix starvation in case we don't have any databases

Modified Paths:
--------------
    trunk/pywikipedia/commonsdelinker/checkusage.py

Modified: trunk/pywikipedia/commonsdelinker/checkusage.py
===================================================================
--- trunk/pywikipedia/commonsdelinker/checkusage.py	2008-05-06 10:37:01 UTC (rev 5314)
+++ trunk/pywikipedia/commonsdelinker/checkusage.py	2008-05-06 10:38:43 UTC (rev 5315)
@@ -374,11 +374,13 @@
 		
 		
 	def close(self):
+		if getattr(self, 'http'):
+			self.http.close()
+		if not hasattr(self, 'databases'): return
 		for connection, cursor in self.databases.itervalues():
 			try:
 				connection.close()
 			except: 
 				pass
-		if self.http:
-			self.http.close()
+
 			
\ No newline at end of file





More information about the Pywikipedia-l mailing list