Author: Brian Kearns <[email protected]>
Branch: 
Changeset: r71107:a951d09ad58f
Date: 2014-04-30 18:23 -0400
http://bitbucket.org/pypy/pypy/changeset/a951d09ad58f/

Log:    fix some numpy dtype_from_spec cases

diff --git a/pypy/module/micronumpy/descriptor.py 
b/pypy/module/micronumpy/descriptor.py
--- a/pypy/module/micronumpy/descriptor.py
+++ b/pypy/module/micronumpy/descriptor.py
@@ -1,3 +1,4 @@
+import string
 from pypy.interpreter.argument import Arguments
 from pypy.interpreter.baseobjspace import W_Root
 from pypy.interpreter.error import OperationError, oefmt
@@ -497,7 +498,9 @@
         return w_dtype
     elif space.isinstance_w(w_dtype, space.w_str):
         name = space.str_w(w_dtype)
-        if ',' in name:
+        if ',' in name or \
+                name[0] in string.digits or \
+                name[0] in '<>=|' and name[1] in string.digits:
             return dtype_from_spec(space, w_dtype)
         cname = name[1:] if name[0] == NPY.OPPBYTE else name
         try:
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to