summaryrefslogtreecommitdiffstats
path: root/Doc/tools
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2010-07-03 10:41:33 (GMT)
committerGeorg Brandl <georg@python.org>2010-07-03 10:41:33 (GMT)
commit4833e5b874d2aad0a19c1c682095733c05adc940 (patch)
tree87c6d14248b83cbf60e3b8b1d4128aac150c5290 /Doc/tools
parent94e5de0df0400f883ecb071b1259942408d6d08b (diff)
downloadcpython-4833e5b874d2aad0a19c1c682095733c05adc940.zip
cpython-4833e5b874d2aad0a19c1c682095733c05adc940.tar.gz
cpython-4833e5b874d2aad0a19c1c682095733c05adc940.tar.bz2
Remove the need for a "()" empty argument list after opcodes.
Diffstat (limited to 'Doc/tools')
-rw-r--r--Doc/tools/sphinxext/pyspecific.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/Doc/tools/sphinxext/pyspecific.py b/Doc/tools/sphinxext/pyspecific.py
index 85cd5bc..a90b238 100644
--- a/Doc/tools/sphinxext/pyspecific.py
+++ b/Doc/tools/sphinxext/pyspecific.py
@@ -5,7 +5,7 @@
Sphinx extension with Python doc-specific markup.
- :copyright: 2008, 2009 by Georg Brandl.
+ :copyright: 2008, 2009, 2010 by Georg Brandl.
:license: Python license.
"""
@@ -149,7 +149,7 @@ import suspicious
import re
from sphinx import addnodes
-opcode_sig_re = re.compile(r'(\w+(?:\+\d)?)\s*\((.*)\)')
+opcode_sig_re = re.compile(r'(\w+(?:\+\d)?)(?:\s*\((.*)\))?')
def parse_opcode_signature(env, sig, signode):
"""Transform an opcode signature into RST nodes."""
@@ -158,9 +158,10 @@ def parse_opcode_signature(env, sig, signode):
raise ValueError
opname, arglist = m.groups()
signode += addnodes.desc_name(opname, opname)
- paramlist = addnodes.desc_parameterlist()
- signode += paramlist
- paramlist += addnodes.desc_parameter(arglist, arglist)
+ if arglist is not None:
+ paramlist = addnodes.desc_parameterlist()
+ signode += paramlist
+ paramlist += addnodes.desc_parameter(arglist, arglist)
return opname.strip()