From 53ae45ad3d5d02009018b07351e97b654c720f7f Mon Sep 17 00:00:00 2001 From: Pablo Hoffman Date: Wed, 21 Oct 2009 16:25:49 -0200 Subject: [PATCH] restored previous try/except catch all blocks for Libxml2Document __del__() method --- scrapy/selector/document.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scrapy/selector/document.py b/scrapy/selector/document.py index 55b2cbd2b..ba75053ea 100644 --- a/scrapy/selector/document.py +++ b/scrapy/selector/document.py @@ -26,12 +26,15 @@ class Libxml2Document(object_ref): # we must call both cleanup functions, so we try/except all exceptions # to make sure one doesn't prevent the other from being called # this call sometimes raises a "NoneType is not callable" TypeError - # also, these calls sometimes raise a "NoneType is not callable" - # TypeError, so the try/except block silences them + # so the try/except block silences them try: self.xmlDoc.freeDoc() - finally: + except: + pass + try: self.xpathContext.xpathFreeContext() + except: + pass def __str__(self): return "" % self.xmlDoc.name