From: Benjamin Peterson <benjamin@python.org>
Date: Sat, 23 Mar 2013 20:22:20 +0000 (-0500)
Subject: return int instead long when possible (#17531)
X-Git-Tag: v2.7.4~15
X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=31289230e2244c1cd0483547e2a4c60c79cfab9d;p=python

return int instead long when possible (#17531)
---

diff --git a/Misc/NEWS b/Misc/NEWS
index b8dc1f22e8..cfa3f64d6b 100644
--- 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
index a06ebd10a3..00decc3982 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -357,7 +357,7 @@ _PyInt_FromUid(uid_t uid)
 {
     if (uid <= LONG_MAX)
         return PyInt_FromLong(uid);
-    return PyLong_FromUnsignedLong(uid);
+    return PyInt_FromUnsignedLong(uid);
 }
 
 PyObject *
@@ -365,7 +365,7 @@ _PyInt_FromGid(gid_t gid)
 {
     if (gid <= LONG_MAX)
         return PyInt_FromLong(gid);
-    return PyLong_FromUnsignedLong(gid);
+    return PyInt_FromUnsignedLong(gid);
 }
 
 int