From 06d33200d3002b322a501f8a7a88b61373f3b390 Mon Sep 17 00:00:00 2001 From: "Jason McCampbell (Enthought, Inc)" Date: Thu, 17 Mar 2011 14:21:41 -0500 Subject: [PATCH] Long is not a subdtype of 'int' on IronPython. --- numpy/matrixlib/defmatrix.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/numpy/matrixlib/defmatrix.py b/numpy/matrixlib/defmatrix.py index cad05cb60..42992c38f 100644 --- a/numpy/matrixlib/defmatrix.py +++ b/numpy/matrixlib/defmatrix.py @@ -158,7 +158,8 @@ def matrix_power(M,n): M = asanyarray(M) if len(M.shape) != 2 or M.shape[0] != M.shape[1]: raise ValueError("input must be a square array") - if not issubdtype(type(n),int): + # Note: need to check int and long for IronPython because 'long' is not a subdtype of 'int'. + if not issubdtype(type(n),int) and not issubdtype(type(n), long): raise TypeError("exponent must be an integer") from numpy.linalg import inv