summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2010-04-02 09:07:42 (GMT)
committerGeorg Brandl <georg@python.org>2010-04-02 09:07:42 (GMT)
commit677fdec8fcf18d0fd7f7b87c3b8adb0afe6dbd96 (patch)
treed6f7730699b3d3711df8a2e322d04c8f46cf5456
parentd3bab6aba992e38470a163d8a4b5afe8a47fc66c (diff)
downloadcpython-677fdec8fcf18d0fd7f7b87c3b8adb0afe6dbd96.zip
cpython-677fdec8fcf18d0fd7f7b87c3b8adb0afe6dbd96.tar.gz
cpython-677fdec8fcf18d0fd7f7b87c3b8adb0afe6dbd96.tar.bz2
Document PyImport_ExecCodeModuleEx().
-rw-r--r--Doc/c-api/import.rst9
-rw-r--r--Doc/data/refcounts.dat12
2 files changed, 21 insertions, 0 deletions
diff --git a/Doc/c-api/import.rst b/Doc/c-api/import.rst
index 2025ba1..3da1415 100644
--- a/Doc/c-api/import.rst
+++ b/Doc/c-api/import.rst
@@ -138,6 +138,9 @@ Importing Modules
such modules have no way to know that the module object is an unknown (and
probably damaged with respect to the module author's intents) state.
+ The module's :attr:`__file__` attribute will be set to the code object's
+ :cmember:`co_filename`.
+
This function will reload the module if it was already imported. See
:cfunc:`PyImport_ReloadModule` for the intended way to reload a module.
@@ -148,6 +151,12 @@ Importing Modules
*name* is removed from :attr:`sys.modules` in error cases.
+.. cfunction:: PyObject* PyImport_ExecCodeModuleEx(char *name, PyObject *co, char *pathname)
+
+ Like :cfunc:`PyImport_ExecCodeModule`, but the :attr:`__file__` attribute of
+ the module object is set to *pathname* if it is non-``NULL``.
+
+
.. cfunction:: long PyImport_GetMagicNumber()
Return the magic number for Python bytecode files (a.k.a. :file:`.pyc` and
diff --git a/Doc/data/refcounts.dat b/Doc/data/refcounts.dat
index 16f0604..8a6eb66 100644
--- a/Doc/data/refcounts.dat
+++ b/Doc/data/refcounts.dat
@@ -495,6 +495,11 @@ PyImport_ExecCodeModule:PyObject*::+1:
PyImport_ExecCodeModule:char*:name::
PyImport_ExecCodeModule:PyObject*:co:0:
+PyImport_ExecCodeModuleEx:PyObject*::+1:
+PyImport_ExecCodeModuleEx:char*:name::
+PyImport_ExecCodeModuleEx:PyObject*:co:0:
+PyImport_ExecCodeModuleEx:char*:pathname::
+
PyImport_GetMagicNumber:long:::
PyImport_GetModuleDict:PyObject*::0:
@@ -514,6 +519,13 @@ PyImport_ImportModuleEx:PyObject*:globals:0:???
PyImport_ImportModuleEx:PyObject*:locals:0:???
PyImport_ImportModuleEx:PyObject*:fromlist:0:???
+PyImport_ImportModuleLevel:PyObject*::+1:
+PyImport_ImportModuleLevel:char*:name::
+PyImport_ImportModuleLevel:PyObject*:globals:0:???
+PyImport_ImportModuleLevel:PyObject*:locals:0:???
+PyImport_ImportModuleLevel:PyObject*:fromlist:0:???
+PyImport_ImportModuleLevel:int:level::
+
PyImport_ReloadModule:PyObject*::+1:
PyImport_ReloadModule:PyObject*:m:0: