diff options
author | Larry Hastings <larry@hastings.org> | 2014-01-06 19:10:08 (GMT) |
---|---|---|
committer | Larry Hastings <larry@hastings.org> | 2014-01-06 19:10:08 (GMT) |
commit | eb31e9d6edc4fd662a92379cb1007768ad6efeec (patch) | |
tree | 508516a5d1e2c5ed8bac412a4efda5b2b8527d77 /Tools/clinic | |
parent | 3f144c2ad76ed16bd2c40fd3c624fb6009ee8aa2 (diff) | |
download | cpython-eb31e9d6edc4fd662a92379cb1007768ad6efeec.zip cpython-eb31e9d6edc4fd662a92379cb1007768ad6efeec.tar.gz cpython-eb31e9d6edc4fd662a92379cb1007768ad6efeec.tar.bz2 |
Issue #20143: The line numbers reported in Argument Clinic errors are
now more accurate.
Diffstat (limited to 'Tools/clinic')
-rwxr-xr-x | Tools/clinic/clinic.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Tools/clinic/clinic.py b/Tools/clinic/clinic.py index 023a034..5351b6d 100755 --- a/Tools/clinic/clinic.py +++ b/Tools/clinic/clinic.py @@ -943,8 +943,9 @@ class BlockParser: fail("Checksum mismatch!\nExpected: {}\nComputed: {}".format(checksum, computed)) else: # put back output - self.input.extend(reversed(output.splitlines(keepends=True))) - self.line_number -= len(output) + output_lines = output.splitlines(keepends=True) + self.line_number -= len(output_lines) + self.input.extend(reversed(output_lines)) output = None return Block(input_output(), dsl_name, output=output) |