diff options
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/core/_internal.py | 2 | ||||
-rw-r--r-- | numpy/core/tests/test_dtype.py | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/numpy/core/_internal.py b/numpy/core/_internal.py index af08c50ed..686b773f2 100644 --- a/numpy/core/_internal.py +++ b/numpy/core/_internal.py @@ -133,7 +133,7 @@ def _reconstruct(subtype, shape, dtype): format_re = re.compile(asbytes( r'(?P<order1>[<>|=]?)' - r'(?P<repeats> *[(]?[ ,0-9]*[)]? *)' + r'(?P<repeats> *[(]?[ ,0-9L]*[)]? *)' r'(?P<order2>[<>|=]?)' r'(?P<dtype>[A-Za-z0-9.]*(?:\[[a-zA-Z0-9,.]+\])?)')) sep_re = re.compile(asbytes(r'\s*,\s*')) diff --git a/numpy/core/tests/test_dtype.py b/numpy/core/tests/test_dtype.py index 246ebba6b..5645a0824 100644 --- a/numpy/core/tests/test_dtype.py +++ b/numpy/core/tests/test_dtype.py @@ -413,6 +413,11 @@ class TestString(TestCase): assert_equal(repr(dt), "dtype([('a', '<M8[D]'), ('b', '<m8[us]')])") + @dec.skipif(sys.version_info[0] > 2) + def test_dtype_str_with_long_in_shape(self): + # Pull request #376 + dt = np.dtype('(1L,)i4') + class TestDtypeAttributeDeletion(object): |