git » libfiu » commit c3cd0ee

bindings/python: Remove unnecessary parameter in failinfo()

author Alberto Bertogli
2020-03-28 15:51:20 UTC
committer Alberto Bertogli
2020-03-28 15:52:55 UTC
parent ffa89556eda5fc05cd496150880519b575c2908e

bindings/python: Remove unnecessary parameter in failinfo()

The failinfo() Python function takes a name as parameter, but it is
misleading as it is never used, and the returned value has no connection
to it.

This is probably an ancient copy-paste error that has gone unnoticed.

This is a breaking API change. However, given how rare calls to this
function are, and that it is probably unused in the wild, and that it
is trivial to fix, I'm going to just mention it in the release notes but
don't think it merits a new major version.

bindings/python/fiu.py +1 -1
tests/test-failinfo_refcount.py +3 -4

diff --git a/bindings/python/fiu.py b/bindings/python/fiu.py
index 20f4a13..8d06dfa 100644
--- a/bindings/python/fiu.py
+++ b/bindings/python/fiu.py
@@ -19,7 +19,7 @@ def fail(name):
 	"Returns the failure status of the given point of failure."
 	return _ll.fail(name)
 
-def failinfo(name):
+def failinfo():
 	"""Returns the information associated with the last failure. Use with
 	care, can be fatal if the point of failure was not enabled via
 	Python."""
diff --git a/tests/test-failinfo_refcount.py b/tests/test-failinfo_refcount.py
index 79062be..a2c0e86 100644
--- a/tests/test-failinfo_refcount.py
+++ b/tests/test-failinfo_refcount.py
@@ -11,11 +11,10 @@ finfo = [1, 2, 3]
 fiu.enable('p1', failinfo = finfo)
 
 assert fiu.fail('p1')
-assert fiu.failinfo('p1') is finfo
+assert fiu.failinfo() is finfo
 
 finfo_id = id(finfo)
 del finfo
 
-assert fiu.failinfo('p1') == [1, 2, 3]
-assert id(fiu.failinfo('p1')) == finfo_id
-
+assert fiu.failinfo() == [1, 2, 3]
+assert id(fiu.failinfo()) == finfo_id