[docs] PyModule_GetDict() claims it can never fail, but it can (issue 12946)

berker.peksag at gmail.com berker.peksag at gmail.com
Sat Aug 6 11:34:30 EDT 2016


http://bugs.python.org/review/12946/diff/18078/Doc/c-api/module.rst
File Doc/c-api/module.rst (right):

http://bugs.python.org/review/12946/diff/18078/Doc/c-api/module.rst#newcode64
Doc/c-api/module.rst:64: :exc:`SystemError` is raised and *NULL* is
returned.
On 2016/08/06 15:47:10, matrixise wrote:
> The assert will raise a SystemError ?

No, the following branch will raise SystemError:

     if (!PyModule_Check(m)) {
         PyErr_BadInternalCall();
         return NULL;
     }

I added the assert statement as a sanity check.

http://bugs.python.org/review/12946/


More information about the docs mailing list