From 6a119c982463097aebc8d004fc731b424721a650 Mon Sep 17 00:00:00 2001 From: Eric Wieser Date: Tue, 1 Aug 2017 17:39:11 +0000 Subject: BUG: Be explicit about allowing all integer types in matrix exponentiation Fixes gh-9506, unsigned exponentiation --- numpy/matrixlib/defmatrix.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'numpy/matrixlib/defmatrix.py') diff --git a/numpy/matrixlib/defmatrix.py b/numpy/matrixlib/defmatrix.py index 2aed3ebde..e016b5f4c 100644 --- a/numpy/matrixlib/defmatrix.py +++ b/numpy/matrixlib/defmatrix.py @@ -137,7 +137,7 @@ def matrix_power(M, n): M = asanyarray(M) if M.ndim != 2 or M.shape[0] != M.shape[1]: raise ValueError("input must be a square array") - if not issubdtype(type(n), int): + if not issubdtype(type(n), N.integer): raise TypeError("exponent must be an integer") from numpy.linalg import inv -- cgit v1.2.1