summaryrefslogtreecommitdiff
path: root/numpy/lib/npyio.py
diff options
context:
space:
mode:
authorAntony Lee <anntzer.lee@gmail.com>2021-08-24 10:37:06 +0200
committerAntony Lee <anntzer.lee@gmail.com>2021-08-24 10:38:53 +0200
commit60116f24a7121e1542fda0655bba56bd3647d26d (patch)
tree55da35750a1b362dac786c0735a00acee7ccce1d /numpy/lib/npyio.py
parent158159d43a988ff418df5aee3c8b3ecfcb1d0986 (diff)
downloadnumpy-60116f24a7121e1542fda0655bba56bd3647d26d.tar.gz
MAINT: Avoid use of confusing compat aliases.
As of Py3, np.compat.unicode == str, but that's not entirely obvious (it could correspond to some numpy dtype too), so just use plain str. Likewise for np.compat.int. tests are intentionally left unchanged, as they can be considered as implicitly testing the np.compat.py3k interface as well.
Diffstat (limited to 'numpy/lib/npyio.py')
-rw-r--r--numpy/lib/npyio.py4
1 files changed, 2 insertions, 2 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'):