[pypy-commit] pypy py3k: PyFloat_FromString lost its deprecated, unused second argument in py3

rlamy pypy.commits at gmail.com
Wed Oct 5 13:51:46 EDT 2016


Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch: py3k
Changeset: r87602:00a741fad1f5
Date: 2016-10-05 18:51 +0100
http://bitbucket.org/pypy/pypy/changeset/00a741fad1f5/

Log:	PyFloat_FromString lost its deprecated, unused second argument in
	py3

diff --git a/pypy/module/cpyext/floatobject.py b/pypy/module/cpyext/floatobject.py
--- a/pypy/module/cpyext/floatobject.py
+++ b/pypy/module/cpyext/floatobject.py
@@ -61,11 +61,12 @@
     This is the equivalent of the Python expression float(o)."""
     return space.call_function(space.w_float, w_obj)
 
- at cpython_api([PyObject, rffi.CCHARPP], PyObject)
-def PyFloat_FromString(space, w_obj, _):
-    """Create a PyFloatObject object based on the string value in str, or
-    NULL on failure.  The pend argument is ignored.  It remains only for
-    backward compatibility."""
+ at cpython_api([PyObject], PyObject)
+def PyFloat_FromString(space, w_obj):
+    """
+    Create a PyFloatObject object based on the string value in str, or
+    NULL on failure.
+    """
     return space.call_function(space.w_float, w_obj)
 
 UCHARP = lltype.Ptr(lltype.Array(
diff --git a/pypy/module/cpyext/test/test_floatobject.py b/pypy/module/cpyext/test/test_floatobject.py
--- a/pypy/module/cpyext/test/test_floatobject.py
+++ b/pypy/module/cpyext/test/test_floatobject.py
@@ -38,7 +38,7 @@
             ("from_string", "METH_NOARGS",
              """
                  PyObject* str = PyUnicode_FromString("1234.56");
-                 PyObject* res = PyFloat_FromString(str, NULL);
+                 PyObject* res = PyFloat_FromString(str);
                  Py_DECREF(str);
                  return res;
              """),


More information about the pypy-commit mailing list