[Python-checkins] cpython (2.7): return int instead long when possible (#17531)

benjamin.peterson python-checkins at python.org
Sat Mar 23 21:24:43 CET 2013


http://hg.python.org/cpython/rev/2aa817e0a645
changeset:   82920:2aa817e0a645
branch:      2.7
parent:      82910:9f714c8ce025
user:        Benjamin Peterson <benjamin at python.org>
date:        Sat Mar 23 15:22:20 2013 -0500
summary:
  return int instead long when possible (#17531)

files:
  Misc/NEWS             |  11 +++++++++++
  Modules/posixmodule.c |   4 ++--
  2 files changed, 13 insertions(+), 2 deletions(-)


diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -1,6 +1,17 @@
 Python News
 +++++++++++
 
+What's New in Python 2.7.4?
+===========================
+
+*Release date: XXXX-XX-XX*
+
+Library
+-------
+
+- Issue #17531: Return group and user ids as int instead long when possible.
+
+
 What's New in Python 2.7.4 release candidate 1
 ==============================================
 
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -357,7 +357,7 @@
 {
     if (uid <= LONG_MAX)
         return PyInt_FromLong(uid);
-    return PyLong_FromUnsignedLong(uid);
+    return PyInt_FromUnsignedLong(uid);
 }
 
 PyObject *
@@ -365,7 +365,7 @@
 {
     if (gid <= LONG_MAX)
         return PyInt_FromLong(gid);
-    return PyLong_FromUnsignedLong(gid);
+    return PyInt_FromUnsignedLong(gid);
 }
 
 int

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


More information about the Python-checkins mailing list