From d7fb7919e352994231182c30a620e677eb288563 Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Tue, 14 Jan 2014 21:02:43 +0100 Subject: Replace assert with a proper error --- Tools/clinic/clinic.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Tools/clinic/clinic.py b/Tools/clinic/clinic.py index 3d4feaf..56e4911 100755 --- a/Tools/clinic/clinic.py +++ b/Tools/clinic/clinic.py @@ -2343,9 +2343,11 @@ class DSLParser: fail("Badly-formed annotation for " + full_name + ": " + returns) try: name, legacy, kwargs = self.parse_converter(module.body[0].returns) - assert not legacy + if legacy: + fail("Legacy converter {!r} not allowed as a return converter" + .format(name)) if name not in return_converters: - fail("Error: No available return converter called " + repr(name)) + fail("No available return converter called " + repr(name)) return_converter = return_converters[name](**kwargs) except ValueError: fail("Badly-formed annotation for " + full_name + ": " + returns) -- cgit v0.12