summaryrefslogtreecommitdiff
path: root/numpy/ma/extras.py
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2014-10-03 20:03:31 -0600
committerCharles Harris <charlesr.harris@gmail.com>2014-10-03 20:06:48 -0600
commitdc453917978e98dcdf3bbc106b080c80f0a1301e (patch)
tree010d0bea581ca040c93dcc41113e88fa69262f60 /numpy/ma/extras.py
parentbbb7c3fbcdc2ddfcf79317661be2b99b1f6617e3 (diff)
downloadnumpy-dc453917978e98dcdf3bbc106b080c80f0a1301e.tar.gz
BUG: Make numpy import when run with Python flag '-OO'.
This consists of checking for a docstring equal to None and skipping two tests that require docstrings. Closes #5148.
Diffstat (limited to 'numpy/ma/extras.py')
-rw-r--r--numpy/ma/extras.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/numpy/ma/extras.py b/numpy/ma/extras.py
index 82a61a67c..a993fd05d 100644
--- a/numpy/ma/extras.py
+++ b/numpy/ma/extras.py
@@ -434,8 +434,10 @@ def apply_over_axes(func, a, axes):
raise ValueError("function is not returning "
"an array of the correct shape")
return val
-apply_over_axes.__doc__ = np.apply_over_axes.__doc__[
- :np.apply_over_axes.__doc__.find('Notes')].rstrip() + \
+
+if apply_over_axes.__doc__ is not None:
+ apply_over_axes.__doc__ = np.apply_over_axes.__doc__[
+ :np.apply_over_axes.__doc__.find('Notes')].rstrip() + \
"""
Examples
@@ -462,7 +464,7 @@ apply_over_axes.__doc__ = np.apply_over_axes.__doc__[
[[[46]
[--]
[124]]]
-"""
+ """
def average(a, axis=None, weights=None, returned=False):