diff --git a/docs/source/whatsnew/development.rst b/docs/source/whatsnew/development.rst index 8097c05..edc6a93 100644 --- a/docs/source/whatsnew/development.rst +++ b/docs/source/whatsnew/development.rst @@ -10,6 +10,7 @@ This document describes in-flight development work. conflicts for other Pull Requests). Instead, create a new file in the `docs/source/whatsnew/pr` folder + .. DO NOT EDIT THIS LINE BEFORE RELEASE. FEATURE INSERTION POINT. @@ -18,4 +19,3 @@ Backwards incompatible changes .. DO NOT EDIT THIS LINE BEFORE RELEASE. INCOMPAT INSERTION POINT. - diff --git a/docs/source/whatsnew/pr/do_where.rst b/docs/source/whatsnew/pr/do_where.rst new file mode 100644 index 0000000..847fa6d --- /dev/null +++ b/docs/source/whatsnew/pr/do_where.rst @@ -0,0 +1,47 @@ +IPython debugger (IPdb) now supports the number of context lines for the +``where`` (and ``w``) commands. The `context` keyword is also available in various APIs. + +.. code:: + + In [2]: def foo(): + ...: 1 + ...: 2 + ...: 3 + ...: 4 + ...: 5 + ...: raise ValueError('6 is not acceptable') + ...: 7 + ...: 8 + ...: 9 + ...: 10 + ...: + + In [3]: foo() + ---------------------------------------------------- + ValueError Traceback (most recent call last) + in () + ----> 1 foo() + + in foo() + 5 4 + 6 5 + ----> 7 raise ValueError('6 is not acceptable') + 8 7 + 9 8 + + ValueError: 6 is not acceptable + + In [4]: debug + > (7)foo() + 5 4 + 6 5 + ----> 7 raise ValueError('6 is not acceptable') + 8 7 + 9 8 + + ipdb> where 1 + (1)() + ----> 1 foo() + + > (7)foo() + ----> 7 raise ValueError('6 is not acceptable') diff --git a/tools/update_whatsnew.py b/tools/update_whatsnew.py index 97646e3..1dcc5fd 100755 --- a/tools/update_whatsnew.py +++ b/tools/update_whatsnew.py @@ -7,6 +7,7 @@ whatsnew/development.rst (chronologically ordered), and deletes the snippets. import io import os +from glob import glob from os.path import dirname, basename, abspath, join as pjoin from subprocess import check_call, check_output @@ -20,15 +21,15 @@ INCOMPAT_MARK = ".. DO NOT EDIT THIS LINE BEFORE RELEASE. INCOMPAT INSERTION POI # 1. Collect the whatsnew snippet files --------------------------------------- -files = set(os.listdir(pr_dir)) +files = set() +for f in glob(pjoin(pr_dir, '*.rst')): + files.add(f) # Ignore explanatory and example files -files.difference_update({'README.md', +files.difference_update({pjoin(pr_dir, f) for f in {'README.md', 'incompat-switching-to-perl.rst', 'antigravity-feature.rst'} - ) + }) -# Absolute paths -files = {pjoin(pr_dir, f) for f in files} def getmtime(f): return check_output(['git', 'log', '-1', '--format="%ai"', '--', f]) @@ -38,7 +39,11 @@ files = sorted(files, key=getmtime) features, incompats = [], [] for path in files: with io.open(path, encoding='utf-8') as f: - content = f.read().rstrip() + try: + content = f.read().rstrip() + except Exception as e: + raise Exception('Error reading "{}"'.format(f)) + if basename(path).startswith('incompat-'): incompats.append(content) else: @@ -72,4 +77,4 @@ for file in files: check_call(['git', 'add', target]) -print("Merged what's new changes. Check the diff and commit the change.") \ No newline at end of file +print("Merged what's new changes. Check the diff and commit the change.")