diff --git a/python/mxnet/test_utils.py b/python/mxnet/test_utils.py index c549f6f59940..7ac63c6c53d5 100644 --- a/python/mxnet/test_utils.py +++ b/python/mxnet/test_utils.py @@ -1999,7 +1999,8 @@ def compare_optimizer(opt1, opt2, shape, dtype, w_stype='default', g_stype='defa compare_ndarray_tuple(state1, state2, rtol=rtol, atol=atol) assert_almost_equal(w1.asnumpy(), w2.asnumpy(), rtol=rtol, atol=atol) -class EnvManager: +class EnvManager(object): + """Environment variable setter and unsetter via with idiom""" def __init__(self, key, val): self._key = key self._next_val = val @@ -2014,4 +2015,3 @@ def __exit__(self, ptype, value, trace): os.environ[self._key] = self._prev_val else: del os.environ[self._key] -