From 5287b715573c9fbb221f8066d67c77dba859624f Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Sat, 7 Dec 2013 08:01:35 +0100 Subject: [PATCH] set another string length field in exception message format --- Cython/Compiler/Nodes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index 763f04d..5bdac34 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -1965,8 +1965,8 @@ class FuncDefNode(StatNode, BlockNode): cname = arg.entry.cname code.putln('if (unlikely(((PyObject *)%s) == Py_None)) {' % cname) - code.putln('''PyErr_Format(PyExc_TypeError, "Argument '%%s' must not be None", "%s"); %s''' % ( - arg.name, + code.putln('''PyErr_Format(PyExc_TypeError, "Argument '%%.%ds' must not be None", "%s"); %s''' % ( + max(200, len(arg.name)), arg.name, code.error_goto(arg.pos))) code.putln('}') -- 2.7.4