Author: Amaury Forgeot d'Arc <amaur...@gmail.com>
Branch: py3.6
Changeset: r93932:0ebac2fc9fb1
Date: 2018-02-26 01:13 +0100
http://bitbucket.org/pypy/pypy/changeset/0ebac2fc9fb1/

Log:    CPython Issue #26129: grp.getgrgid() sends a DeprecationWarning when
        passing non-integers

diff --git a/lib_pypy/grp.py b/lib_pypy/grp.py
--- a/lib_pypy/grp.py
+++ b/lib_pypy/grp.py
@@ -33,7 +33,13 @@
 
 @builtinify
 def getgrgid(gid):
-    res = lib.getgrgid(gid)
+    try:
+        res = lib.getgrgid(gid)
+    except TypeError:
+        gid = int(gid)
+        res = lib.getgrgid(gid)
+        import warnings
+        warnings.warn("group id must be int", DeprecationWarning)
     if not res:
         # XXX maybe check error eventually
         raise KeyError(gid)
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to