Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit eb31e9d

Browse files
committed
Issue #20143: The line numbers reported in Argument Clinic errors are
now more accurate.
1 parent 3f144c2 commit eb31e9d

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ Library
1616
Tools/Demos
1717
-----------
1818

19+
- Issue #20143: The line numbers reported in Argument Clinic errors are
20+
now more accurate.
21+
1922
- Issue #20142: Py_buffer variables generated by Argument Clinic are now
2023
initialized with a default value.
2124

Tools/clinic/clinic.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -943,8 +943,9 @@ def parse_clinic_block(self, dsl_name):
943943
fail("Checksum mismatch!\nExpected: {}\nComputed: {}".format(checksum, computed))
944944
else:
945945
# put back output
946-
self.input.extend(reversed(output.splitlines(keepends=True)))
947-
self.line_number -= len(output)
946+
output_lines = output.splitlines(keepends=True)
947+
self.line_number -= len(output_lines)
948+
self.input.extend(reversed(output_lines))
948949
output = None
949950

950951
return Block(input_output(), dsl_name, output=output)

0 commit comments

Comments
 (0)