Permalink
Browse files

Error message fix for very old/new Python versions.

  • Loading branch information...
1 parent 7050740 commit 8982a94c2b7652a754b5370fdf92eca01b21e4d1 @robertwb robertwb committed May 8, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 Cython/Compiler/Errors.py
@@ -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):

0 comments on commit 8982a94

Please sign in to comment.