From 3476834e076ef4267949f542a45dfa1bda49ed30 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Thu, 15 Apr 2010 12:33:14 +0200 Subject: [PATCH] print correct column in error message --- Cython/Compiler/Nodes.py | 4 ++-- tests/errors/e_notnone2.pyx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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' """ -- 2.26.2