Skip to content

Commit

Permalink
TST: filter Cython warning on import of random module. Closes #2103.
Browse files Browse the repository at this point in the history
  • Loading branch information
rgommers committed Apr 15, 2012
1 parent 59019f1 commit 0574e05
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion numpy/random/__init__.py
Expand Up @@ -88,7 +88,17 @@
"""
# To get sub-modules
from info import __doc__, __all__
from mtrand import *

import warnings
from numpy.testing.utils import WarningManager

warn_ctx = WarningManager()
warn_ctx.__enter__()
try:
warnings.filterwarnings("ignore", message="numpy.ndarray size changed")
from mtrand import *
finally:
warn_ctx.__exit__()

# Some aliases:
ranf = random = sample = random_sample
Expand Down

0 comments on commit 0574e05

Please sign in to comment.