From ab5a8a2d2d019c4962cd08b0b37b5d48b63ec880 Mon Sep 17 00:00:00 2001 From: Travis Oliphant Date: Thu, 19 Oct 2006 15:18:55 +0000 Subject: Fix longfloat test on platforms where they are the same as doubles. Add ability to set error call-back/logging-object in errstate object. --- numpy/core/numeric.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'numpy/core/numeric.py') diff --git a/numpy/core/numeric.py b/numpy/core/numeric.py index 8ac6ff726..0f6f02eed 100644 --- a/numpy/core/numeric.py +++ b/numpy/core/numeric.py @@ -781,11 +781,17 @@ class errstate(object): # Note that we don't want to run the above doctests because they will fail # without a from __future__ import with_statement def __init__(self, **kwargs): + try: + self.errcall = kwargs.pop('errcall') + except KeyError: + self.errcall = None self.kwargs = kwargs def __enter__(self): self.oldstate = seterr(**self.kwargs) + self.oldcall = seterrcall(self.errcall) def __exit__(self, *exc_info): seterr(**self.oldstate) + seterrcall(self.oldcall) def _setdef(): defval = [UFUNC_BUFSIZE_DEFAULT, ERR_DEFAULT2, None] -- cgit v1.2.1