summaryrefslogtreecommitdiff
path: root/numpy/random/__init__.py
diff options
context:
space:
mode:
authorRalf Gommers <ralf.gommers@googlemail.com>2013-07-16 12:28:18 -0700
committerRalf Gommers <ralf.gommers@googlemail.com>2013-07-16 12:28:18 -0700
commitc067c156bf2ffb96d93083e468158ecbc35baba4 (patch)
treeb73812a3a1a95a044c07c6352b5e254ffd792793 /numpy/random/__init__.py
parentb55f2752140de3bd6969dd66960f649da44974a5 (diff)
parent05a15c8b621f953607429f3b67e079dfe1b439d6 (diff)
downloadnumpy-c067c156bf2ffb96d93083e468158ecbc35baba4.tar.gz
Merge pull request #3520 from charris/replace-warningmanager
Replace use of WarningManager by warnings.catch_warnings and then deprecate it.
Diffstat (limited to 'numpy/random/__init__.py')
-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