get old_state before using seterr
@@ -71,6 +71,8 @@ def seterr(*, divide=None, over=None, under=None,
"""
TODO(hvy): Write docs.
"""
+ old_state = geterr()
+
if divide is not None:
raise NotImplementedError()
if over is not None:
@@ -85,9 +87,6 @@ def seterr(*, divide=None, over=None, under=None,
if fallback_mode is not None:
fbm.seterr(fallback_mode)
- old_state = geterr()
-
-
_config.divide = divide
_config.under = under
_config.over = over
