Frame.block's docs just say: -- Function: Frame.block () Return the frame's code block. *Note Blocks In Python::. However it ought to mention that if the frame does not have a block, then an exception is thrown.
The master branch has been updated by Tom Tromey <tromey@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=60c0454d3dda99635d331f6002f3f04fe34546a7 commit 60c0454d3dda99635d331f6002f3f04fe34546a7 Author: Tom Tromey <tom@tromey.com> Date: Sat Sep 8 09:08:56 2018 -0600 Document that Frame.block can throw PR python/16484 points out that Frame.block can throw an exception, but this is not documented. This patch fixes the documentation. Changing Frame.block to return None would be nice, but I suspect it's too late for that change. gdb/doc/ChangeLog 2018-09-10 Tom Tromey <tom@tromey.com> PR python/16484: * python.texi (Frames In Python): Document that Frame.block can throw.
Fixed.