[Python-checkins] cpython: Issue #20143: The line numbers reported in Argument Clinic errors are

larry.hastings python-checkins at python.org
Mon Jan 6 20:10:57 CET 2014


http://hg.python.org/cpython/rev/9c8d31d69044
changeset: 88326:9c8d31d69044
user: Larry Hastings <larry at hastings.org>
date: Mon Jan 06 11:10:08 2014 -0800
summary:
 Issue #20143: The line numbers reported in Argument Clinic errors are
now more accurate.
files:
 Misc/NEWS | 3 +++
 Tools/clinic/clinic.py | 5 +++--
 2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -16,6 +16,9 @@
 Tools/Demos
 -----------
 
+- Issue #20143: The line numbers reported in Argument Clinic errors are
+ now more accurate.
+
 - Issue #20142: Py_buffer variables generated by Argument Clinic are now
 initialized with a default value.
 
diff --git a/Tools/clinic/clinic.py b/Tools/clinic/clinic.py
--- a/Tools/clinic/clinic.py
+++ b/Tools/clinic/clinic.py
@@ -943,8 +943,9 @@
 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)
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /