All pastes #451802 Raw Edit

Mine

public text v1 · immutable
·published 2007-04-21 20:54 UTC
rendered paste body
class ParseError(Exception):
	def __init__(self, message):
		from django.utils.functional import Promise
		"ParseError can be passed a string or a list."
		if isinstance(message, list):
			self.messages = message
		else:
			assert isinstance(message, (basestring, Promise)), ("%s should be a string" % repr(message))
		self.messages = [message]
		
	def __str__(self):
		return str(self.messages)