summaryrefslogtreecommitdiff
path: root/numpy/random
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/random')
-rw-r--r--numpy/random/__init__.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/numpy/random/__init__.py b/numpy/random/__init__.py
index 1c4f9b6fb..80723cec6 100644
--- a/numpy/random/__init__.py
+++ b/numpy/random/__init__.py
@@ -88,19 +88,15 @@ set_state Set state of generator.
"""
from __future__ import division, absolute_import, print_function
+import warnings
+
# To get sub-modules
from .info import __doc__, __all__
-import warnings
-from numpy.testing.utils import WarningManager
-warn_ctx = WarningManager()
-warn_ctx.__enter__()
-try:
+with warnings.catch_warnings():
warnings.filterwarnings("ignore", message="numpy.ndarray size changed")
from .mtrand import *
-finally:
- warn_ctx.__exit__()
# Some aliases:
ranf = random = sample = random_sample