Make the infinite-recusrion fix more explicit.

So we remember what happened and don't accidentally regress in the
future.
This commit is contained in:
Kale Kundert 2018-08-01 12:08:03 -07:00
parent 7d13599ba1
commit b8255308d6
No known key found for this signature in database
GPG Key ID: C6238221D17CAFAE
1 changed files with 3 additions and 1 deletions

View File

@ -211,7 +211,9 @@ class ApproxScalar(ApproxBase):
the pre-specified tolerance.
"""
if _is_numpy_array(actual):
return all(self == a for a in actual.flat)
# Call ``__eq__()`` manually to prevent infinite-recursion with
# numpy<1.13. See #3748.
return all(self.__eq__(a) for a in actual.flat)
# Short-circuit exact equality.
if actual == self.expected: