From 5778ecf15dd4a3c30b1a6b0170aec6187662dce9 Mon Sep 17 00:00:00 2001 From: samus_ Date: Tue, 22 Jul 2008 14:19:41 +0000 Subject: [PATCH] small fix for string representation of XPathSelector when the node is not an xml object --HG-- extra : convert_revision : svn%3Ab85faa78-f9eb-468e-a121-7cced6da292c%4085 --- scrapy/trunk/scrapy/xpath/selector.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scrapy/trunk/scrapy/xpath/selector.py b/scrapy/trunk/scrapy/xpath/selector.py index 566ed53d5..bdc30cf89 100644 --- a/scrapy/trunk/scrapy/xpath/selector.py +++ b/scrapy/trunk/scrapy/xpath/selector.py @@ -78,7 +78,7 @@ class XPathSelector(object): self.doc.xpathContext.xpathRegisterNs(prefix, uri) def __str__(self): - return "<%s (%s) xpath=%s>" % (type(self).__name__, getattr(self.xmlNode, 'name'), self.expr) + return "<%s (%s) xpath=%s>" % (type(self).__name__, getattr(self.xmlNode, 'name', type(self.xmlNode).__name__), self.expr) __repr__ = __str__