From 2743fb0a27a9fbc346c81769c783916238abc391 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Sun, 14 Mar 2010 13:00:23 +0100 Subject: [PATCH] fix tests after changing error output --- Cython/Compiler/Options.py | 4 ++-- tests/errors/e_directives.pyx | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Cython/Compiler/Options.py b/Cython/Compiler/Options.py index 08a38d32..270e19ff 100644 --- a/Cython/Compiler/Options.py +++ b/Cython/Compiler/Options.py @@ -116,13 +116,13 @@ def parse_directive_value(name, value, relaxed_bool=False): value = value.lower() if value in ("true", "yes"): return True elif value in ("false", "no"): return False - raise ValueError("%s directive must be set to True or False, got %r" % ( + raise ValueError("%s directive must be set to True or False, got '%s'" % ( name, orig_value)) elif type is int: try: return int(value) except ValueError: - raise ValueError("%s directive must be set to an integer, got %r" % ( + raise ValueError("%s directive must be set to an integer, got '%s'" % ( name, orig_value)) elif type is str: return str(value) diff --git a/tests/errors/e_directives.pyx b/tests/errors/e_directives.pyx index f63270fd..f7f777ac 100644 --- a/tests/errors/e_directives.pyx +++ b/tests/errors/e_directives.pyx @@ -9,7 +9,6 @@ print 3 # cython: boundscheck = true _ERRORS = u""" -3:0: boundscheck directive must be set to True or False -4:0: boundscheck directive must be set to True or False +3:0: boundscheck directive must be set to True or False, got 'true' +4:0: boundscheck directive must be set to True or False, got '9' """ - -- 2.26.2