Commit 8982a94c authored by Robert Bradshaw's avatar Robert Bradshaw

Error message fix for very old/new Python versions.

parent 70507406
......@@ -48,16 +48,17 @@ class CompileError(PyrexError):
def __init__(self, position = None, message = u""):
self.position = position
self.message_only = message
self.formatted_message = format_error(message, position)
self.reported = False
# Deprecated and withdrawn in 2.6:
# self.message = message
Exception.__init__(self, format_error(message, position))
Exception.__init__(self, self.formatted_message)
# Python Exception subclass pickling is broken,
# see http://bugs.python.org/issue1692335
self.args = (position, message)
def __str__(self):
return self.message
return self.formatted_message
class CompileWarning(PyrexWarning):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment