Commits

Walter Dörwald committed 93a5b1c

AttributeNotFoundError funktioniert wieder (hoffentlich).

  • Participants
  • Parent commits 6614ca0

Comments (0)

Files changed (1)

File xist/errors.py

 	exception that is raised, when an attribute is fetched that isn't there
 	"""
 
-	def __init__(self, element, attr):
+	def __init__(self, element, attrname):
 		Error.__init__(self)
 		self.element = element
-		self.attr = attr
+		self.attrname = attrname
 
 	def __str__(self):
 		attrs = self.element.attrs.keys()
 
-		s = Error.__str__(self) + "Attribute " + xsc.strAttrName(self.attr) + " not found in element " + xsc._strNode(self.element.__class__) +". "
+		s = Error.__str__(self) + "Attribute %s not found in element %s. " % (persenters.strAttrName(self.attrname), presenters.strElementWithBrackets(self.element))
 
 		if len(attrs):
 			attrs.sort()
-			attrs = ", ".join(map(xsc.strAttrName, attrs))
-			s = s + "Available attributes are: " + attrs + "."
+			attrs = ", ".join([ str(presenters.strAttrName(attr)) for attr in attrs ])
+			s = s + "Available attributes are: %s." % attrs
 		else:
 			s = s + "No attributes available."