summaryrefslogtreecommitdiff
path: root/numpy/core/defmatrix.py
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2006-01-06 10:31:45 +0000
committerTravis Oliphant <oliphant@enthought.com>2006-01-06 10:31:45 +0000
commit2dee64455c7e32db4e51c1d531a10a714f3da2d7 (patch)
treefa34ab9559bb0c6ca2dc97cc8b4a5630ee59b9c5 /numpy/core/defmatrix.py
parent36d71451129490dcaa88f903f5090f42fd42d073 (diff)
downloadnumpy-2dee64455c7e32db4e51c1d531a10a714f3da2d7.tar.gz
Fixed up errors..
Diffstat (limited to 'numpy/core/defmatrix.py')
-rw-r--r--numpy/core/defmatrix.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/numpy/core/defmatrix.py b/numpy/core/defmatrix.py
index 9eb8e0011..b0d45972e 100644
--- a/numpy/core/defmatrix.py
+++ b/numpy/core/defmatrix.py
@@ -63,7 +63,10 @@ class matrix(N.ndarray):
return data.astype(dtype)
if isinstance(data, N.ndarray):
- intype = N.dtypedescr(dtype)
+ if dtype is None:
+ intype = data.dtypedescr
+ else:
+ intype = N.dtypedescr(dtype)
new = data.view(matrix)
if intype != data.dtypedescr:
return new.astype(intype)