summaryrefslogtreecommitdiff
path: root/numpy/core/fromnumeric.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/core/fromnumeric.py')
-rw-r--r--numpy/core/fromnumeric.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/numpy/core/fromnumeric.py b/numpy/core/fromnumeric.py
index 63279ffb3..5f1aadbf5 100644
--- a/numpy/core/fromnumeric.py
+++ b/numpy/core/fromnumeric.py
@@ -1280,13 +1280,10 @@ def squeeze(a, axis=None):
squeeze = a.squeeze
except AttributeError:
return _wrapit(a, 'squeeze')
- try:
- # First try to use the new axis= parameter
- return squeeze(axis=axis)
- except TypeError:
- # For backwards compatibility
+ if axis is None:
return squeeze()
-
+ else:
+ return squeeze(axis=axis)
def diagonal(a, offset=0, axis1=0, axis2=1):
"""