[Python-checkins] cpython (3.4): merge 3.3 (#20594)

larry.hastings python-checkins at python.org
Mon Mar 17 07:31:31 CET 2014


http://hg.python.org/cpython/rev/fd49c1d2fd6c
changeset:   89703:fd49c1d2fd6c
branch:      3.4
user:        Benjamin Peterson <benjamin at python.org>
date:        Tue Feb 11 10:19:12 2014 -0500
summary:
  merge 3.3 (#20594)

files:
  Misc/NEWS             |   2 ++
  Modules/posixmodule.c |  10 +++++++---
  2 files changed, 9 insertions(+), 3 deletions(-)


diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -13,6 +13,8 @@
 Library
 -------
 
+- Issue #20594: Avoid name clash with the libc function posix_close.
+
 
 What's New in Python 3.4.0 release candidate 1?
 ===============================================
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -7763,8 +7763,12 @@
 "close(fd)\n\n\
 Close a file descriptor (for low level IO).");
 
-static PyObject *
-posix_close(PyObject *self, PyObject *args)
+/*
+The underscore at end of function name avoids a name clash with the libc
+function posix_close.
+*/
+static PyObject *
+posix_close_(PyObject *self, PyObject *args)
 {
     int fd, res;
     if (!PyArg_ParseTuple(args, "i:close", &fd))
@@ -11422,7 +11426,7 @@
     {"open",            (PyCFunction)posix_open,\
                         METH_VARARGS | METH_KEYWORDS,
                         posix_open__doc__},
-    {"close",           posix_close, METH_VARARGS, posix_close__doc__},
+    {"close",           posix_close_, METH_VARARGS, posix_close__doc__},
     {"closerange",      posix_closerange, METH_VARARGS, posix_closerange__doc__},
     {"device_encoding", device_encoding, METH_VARARGS, device_encoding__doc__},
     {"dup",             posix_dup, METH_VARARGS, posix_dup__doc__},

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


More information about the Python-checkins mailing list