diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2019-08-28 17:43:47 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-28 17:43:47 -0600 |
commit | 766a88d2a1fcc03c74d19a6c04b87ab825819067 (patch) | |
tree | efb7d38b597e623d7e05c29eda2f3521acd4f6e1 /numpy/testing/_private | |
parent | 9cc5f99f3281ade5eef6b097f5853eb8bb471416 (diff) | |
parent | bd59cd437be25443d918ddb558563a1581db8738 (diff) | |
download | numpy-766a88d2a1fcc03c74d19a6c04b87ab825819067.tar.gz |
Merge pull request #14364 from hugovk/fix-flake8-2020
MAINT: Fixes for prospective Python 3.10 and 4.0
Diffstat (limited to 'numpy/testing/_private')
-rw-r--r-- | numpy/testing/_private/parameterized.py | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/numpy/testing/_private/parameterized.py b/numpy/testing/_private/parameterized.py index a5fa4fb5e..489d8e09a 100644 --- a/numpy/testing/_private/parameterized.py +++ b/numpy/testing/_private/parameterized.py @@ -45,11 +45,18 @@ except ImportError: from unittest import TestCase -PY3 = sys.version_info[0] == 3 PY2 = sys.version_info[0] == 2 -if PY3: +if PY2: + from types import InstanceType + lzip = zip + text_type = unicode + bytes_type = str + string_types = basestring, + def make_method(func, instance, type): + return MethodType(func, instance, type) +else: # Python 3 doesn't have an InstanceType, so just use a dummy type. class InstanceType(): pass @@ -61,14 +68,6 @@ if PY3: if instance is None: return func return MethodType(func, instance) -else: - from types import InstanceType - lzip = zip - text_type = unicode - bytes_type = str - string_types = basestring, - def make_method(func, instance, type): - return MethodType(func, instance, type) _param = namedtuple("param", "args kwargs") |