Commit 6cdcdbcd authored by Georg Brandl's avatar Georg Brandl

Patch #1542681: add entries for "with", "as" and "CONTEXTMANAGERS" to

pydoc's help keywords.
 (backport from rev. 54329)
parent 0a24d105
...@@ -1504,6 +1504,7 @@ def writedocs(dir, pkgpath='', done=None): ...@@ -1504,6 +1504,7 @@ def writedocs(dir, pkgpath='', done=None):
class Helper: class Helper:
keywords = { keywords = {
'and': 'BOOLEAN', 'and': 'BOOLEAN',
'as': 'with',
'assert': ('ref/assert', ''), 'assert': ('ref/assert', ''),
'break': ('ref/break', 'while for'), 'break': ('ref/break', 'while for'),
'class': ('ref/class', 'CLASSES SPECIALMETHODS'), 'class': ('ref/class', 'CLASSES SPECIALMETHODS'),
...@@ -1531,6 +1532,7 @@ class Helper: ...@@ -1531,6 +1532,7 @@ class Helper:
'return': ('ref/return', 'FUNCTIONS'), 'return': ('ref/return', 'FUNCTIONS'),
'try': ('ref/try', 'EXCEPTIONS'), 'try': ('ref/try', 'EXCEPTIONS'),
'while': ('ref/while', 'break continue if TRUTHVALUE'), 'while': ('ref/while', 'break continue if TRUTHVALUE'),
'with': ('ref/with', 'CONTEXTMANAGERS EXCEPTIONS yield'),
'yield': ('ref/yield', ''), 'yield': ('ref/yield', ''),
} }
...@@ -1612,6 +1614,7 @@ class Helper: ...@@ -1612,6 +1614,7 @@ class Helper:
'LOOPING': ('ref/compound', 'for while break continue'), 'LOOPING': ('ref/compound', 'for while break continue'),
'TRUTHVALUE': ('lib/truth', 'if while and or not BASICMETHODS'), 'TRUTHVALUE': ('lib/truth', 'if while and or not BASICMETHODS'),
'DEBUGGING': ('lib/module-pdb', 'pdb'), 'DEBUGGING': ('lib/module-pdb', 'pdb'),
'CONTEXTMANAGERS': ('ref/context-managers', 'with'),
} }
def __init__(self, input, output): def __init__(self, input, output):
......
...@@ -202,6 +202,9 @@ Extension Modules ...@@ -202,6 +202,9 @@ Extension Modules
Library Library
------- -------
- Patch #1542681: add entries for "with", "as" and "CONTEXTMANAGERS" to
pydoc's help keywords.
- Patch #1192590: Fix pdb's "ignore" and "condition" commands so they trap - Patch #1192590: Fix pdb's "ignore" and "condition" commands so they trap
the IndexError caused by passing in an invalid breakpoint number. the IndexError caused by passing in an invalid breakpoint number.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment