[Python-checkins] cpython (merge 3.2 -> 3.2): merge heads

benjamin.peterson python-checkins at python.org
Wed Oct 31 19:14:21 CET 2012


http://hg.python.org/cpython/rev/dc47b093d2a4
changeset:   80110:dc47b093d2a4
branch:      3.2
parent:      80109:a965eac352ec
parent:      80101:e9ea7f6a7107
user:        Benjamin Peterson <benjamin at python.org>
date:        Wed Oct 31 14:06:07 2012 -0400
summary:
  merge heads

files:
  Doc/c-api/sys.rst            |   6 ------
  Doc/data/refcounts.dat       |   4 ----
  Doc/extending/embedding.rst  |  21 +++++++++++++--------
  Doc/library/ctypes.rst       |   4 ++--
  Misc/NEWS                    |   2 ++
  Modules/_collectionsmodule.c |   2 +-
  6 files changed, 18 insertions(+), 21 deletions(-)


diff --git a/Doc/c-api/sys.rst b/Doc/c-api/sys.rst
--- a/Doc/c-api/sys.rst
+++ b/Doc/c-api/sys.rst
@@ -61,12 +61,6 @@
    Return the object *name* from the :mod:`sys` module or *NULL* if it does
    not exist, without setting an exception.
 
-.. c:function:: FILE *PySys_GetFile(char *name, FILE *def)
-
-   Return the :c:type:`FILE*` associated with the object *name* in the
-   :mod:`sys` module, or *def* if *name* is not in the module or is not associated
-   with a :c:type:`FILE*`.
-
 .. c:function:: int PySys_SetObject(char *name, PyObject *v)
 
    Set *name* in the :mod:`sys` module to *v* unless *v* is *NULL*, in which
diff --git a/Doc/data/refcounts.dat b/Doc/data/refcounts.dat
--- a/Doc/data/refcounts.dat
+++ b/Doc/data/refcounts.dat
@@ -1310,10 +1310,6 @@
 PySys_AddXOption:void:::
 PySys_AddXOption:const wchar_t*:s::
 
-PySys_GetFile:FILE*:::
-PySys_GetFile:char*:name::
-PySys_GetFile:FILE*:def::
-
 PySys_GetObject:PyObject*::0:
 PySys_GetObject:char*:name::
 
diff --git a/Doc/extending/embedding.rst b/Doc/extending/embedding.rst
--- a/Doc/extending/embedding.rst
+++ b/Doc/extending/embedding.rst
@@ -58,6 +58,7 @@
    int
    main(int argc, char *argv[])
    {
+     Py_SetProgramName(argv[0]);  /* optional but recommended */
      Py_Initialize();
      PyRun_SimpleString("from time import time,ctime\n"
                         "print('Today is', ctime(time()))\n");
@@ -65,14 +66,18 @@
      return 0;
    }
 
-The above code first initializes the Python interpreter with
-:c:func:`Py_Initialize`, followed by the execution of a hard-coded Python script
-that print the date and time.  Afterwards, the :c:func:`Py_Finalize` call shuts
-the interpreter down, followed by the end of the program.  In a real program,
-you may want to get the Python script from another source, perhaps a text-editor
-routine, a file, or a database.  Getting the Python code from a file can better
-be done by using the :c:func:`PyRun_SimpleFile` function, which saves you the
-trouble of allocating memory space and loading the file contents.
+Function :c:func:`Py_SetProgramName` should be called before
+:c:func:`Py_Initialize` to inform the interpreter about paths to
+Python run-time libraries.  Next initialize the Python interpreter
+with :c:func:`Py_Initialize`, followed by the execution of a
+hard-coded Python script that prints the date and time.  Afterwards,
+the :c:func:`Py_Finalize` call shuts the interpreter down, followed by
+the end of the program.  In a real program, you may want to get the
+Python script from another source, perhaps a text-editor routine, a
+file, or a database.  Getting the Python code from a file can better
+be done by using the :c:func:`PyRun_SimpleFile` function, which saves
+you the trouble of allocating memory space and loading the file
+contents.
 
 
 .. _lower-level-embedding:
diff --git a/Doc/library/ctypes.rst b/Doc/library/ctypes.rst
--- a/Doc/library/ctypes.rst
+++ b/Doc/library/ctypes.rst
@@ -1155,8 +1155,8 @@
 Surprises
 ^^^^^^^^^
 
-There are some edges in :mod:`ctypes` where you may be expect something else than
-what actually happens.
+There are some edges in :mod:`ctypes` where you might expect something other
+than what actually happens.
 
 Consider the following example::
 
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -61,6 +61,8 @@
 - Issue #15368: An issue that caused bytecode generation to be
   non-deterministic when using randomized hashing (-R) has been fixed.
 
+- Issue #16369: Global PyTypeObjects not initialized with PyType_Ready(...).
+
 - Issue #15020: The program name used to search for Python's path is now
   "python3" under Unix, not "python".
 
diff --git a/Modules/_collectionsmodule.c b/Modules/_collectionsmodule.c
--- a/Modules/_collectionsmodule.c
+++ b/Modules/_collectionsmodule.c
@@ -1019,7 +1019,7 @@
 };
 
 PyDoc_STRVAR(deque_doc,
-"deque(iterable[, maxlen]) --> deque object\n\
+"deque([iterable[, maxlen]]) --> deque object\n\
 \n\
 Build an ordered collection with optimized access from its endpoints.");
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list