]> granicus.if.org Git - python/commitdiff
Issue #12946: Document that PyModule_GetDict can fail in some cases
authorBerker Peksag <berker.peksag@gmail.com>
Fri, 19 Aug 2016 08:51:39 +0000 (11:51 +0300)
committerBerker Peksag <berker.peksag@gmail.com>
Fri, 19 Aug 2016 08:51:39 +0000 (11:51 +0300)
Doc/c-api/module.rst

index 34f8443931b10ca8694aa3724b804ab663514ecc..e810c69b1d83a23c11cb38a32d80010af573ded2 100644 (file)
@@ -59,10 +59,13 @@ Module Objects
    .. index:: single: __dict__ (module attribute)
 
    Return the dictionary object that implements *module*'s namespace; this object
-   is the same as the :attr:`~object.__dict__` attribute of the module object.  This
-   function never fails.  It is recommended extensions use other
-   :c:func:`PyModule_\*` and :c:func:`PyObject_\*` functions rather than directly
-   manipulate a module's :attr:`~object.__dict__`.
+   is the same as the :attr:`~object.__dict__` attribute of the module object.
+   If *module* is not a module object (or a subtype of a module object),
+   :exc:`SystemError` is raised and *NULL* is returned.
+
+   It is recommended extensions use other :c:func:`PyModule_\*` and
+   :c:func:`PyObject_\*` functions rather than directly manipulate a module's
+   :attr:`~object.__dict__`.
 
 
 .. c:function:: PyObject* PyModule_GetNameObject(PyObject *module)