diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2014-01-14 20:02:43 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2014-01-14 20:02:43 (GMT) |
commit | d7fb7919e352994231182c30a620e677eb288563 (patch) | |
tree | 8827b402a32e5dd3581753415089f9edba23fcb9 /Tools/clinic | |
parent | f5207e617b30495b09280081d4a0347ab516e97e (diff) | |
download | cpython-d7fb7919e352994231182c30a620e677eb288563.zip cpython-d7fb7919e352994231182c30a620e677eb288563.tar.gz cpython-d7fb7919e352994231182c30a620e677eb288563.tar.bz2 |
Replace assert with a proper error
Diffstat (limited to 'Tools/clinic')
-rwxr-xr-x | Tools/clinic/clinic.py | 6 |
1 files 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) |