diff options
-rw-r--r-- | numpy/lib/npyio.py | 4 | ||||
-rw-r--r-- | numpy/random/_generator.pyx | 2 | ||||
-rw-r--r-- | numpy/random/mtrand.pyx | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/numpy/lib/npyio.py b/numpy/lib/npyio.py index 91c25078b..dfcb07d4f 100644 --- a/numpy/lib/npyio.py +++ b/numpy/lib/npyio.py @@ -1537,9 +1537,9 @@ def fromregex(file, regexp, dtype, encoding=None): dtype = np.dtype(dtype) content = file.read() - if isinstance(content, bytes) and isinstance(regexp, np.compat.unicode): + if isinstance(content, bytes) and isinstance(regexp, str): regexp = asbytes(regexp) - elif isinstance(content, np.compat.unicode) and isinstance(regexp, bytes): + elif isinstance(content, str) and isinstance(regexp, bytes): regexp = asstr(regexp) if not hasattr(regexp, 'match'): diff --git a/numpy/random/_generator.pyx b/numpy/random/_generator.pyx index e2430d139..60b6bfc72 100644 --- a/numpy/random/_generator.pyx +++ b/numpy/random/_generator.pyx @@ -561,7 +561,7 @@ cdef class Generator: raise TypeError('Unsupported dtype %r for integers' % _dtype) - if size is None and dtype in (bool, int, np.compat.long): + if size is None and dtype in (bool, int): if np.array(ret).shape == (): return dtype(ret) return ret diff --git a/numpy/random/mtrand.pyx b/numpy/random/mtrand.pyx index 4f5862faa..c9d8ee8e3 100644 --- a/numpy/random/mtrand.pyx +++ b/numpy/random/mtrand.pyx @@ -763,7 +763,7 @@ cdef class RandomState: else: raise TypeError('Unsupported dtype %r for randint' % _dtype) - if size is None and dtype in (bool, int, np.compat.long): + if size is None and dtype in (bool, int): if np.array(ret).shape == (): return dtype(ret) return ret |