From: Stefan Behnel Date: Thu, 15 Apr 2010 10:33:14 +0000 (+0200) Subject: print correct column in error message X-Git-Tag: 0.13.beta0~204 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=3476834e076ef4267949f542a45dfa1bda49ed30;p=cython.git print correct column in error message --- diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index c341e225..9d74c2fd 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -1906,9 +1906,9 @@ class DefNode(FuncDefNode): else: arg.accept_none = True # won't be used, but must be there if arg.not_none: - error(self.pos, "Only Python type arguments can have 'not None'") + error(arg.pos, "Only Python type arguments can have 'not None'") if arg.or_none: - error(self.pos, "Only Python type arguments can have 'or None'") + error(arg.pos, "Only Python type arguments can have 'or None'") def analyse_signature(self, env): if self.entry.is_special: diff --git a/tests/errors/e_notnone2.pyx b/tests/errors/e_notnone2.pyx index cb2defd7..8e2fe3ec 100644 --- a/tests/errors/e_notnone2.pyx +++ b/tests/errors/e_notnone2.pyx @@ -1,6 +1,6 @@ def eggs(int x not None, char* y not None): pass _ERRORS = u""" -1:0: Only Python type arguments can have 'not None' -1:0: Only Python type arguments can have 'not None' +1: 9: Only Python type arguments can have 'not None' +1:25: Only Python type arguments can have 'not None' """