diff options
author | Hugo <hugovk@users.noreply.github.com> | 2019-08-26 18:00:43 +0300 |
---|---|---|
committer | Hugo <hugovk@users.noreply.github.com> | 2019-08-26 18:23:07 +0300 |
commit | 5c02fedbe1585a8e2ae530ec34d44dc80eadd4e5 (patch) | |
tree | eab4a93d50a3ec03edd21ee63c32cf2403251ba5 /numpy/testing/_private/parameterized.py | |
parent | e7c1f8e789d8ccea6034f791393a2122e1237886 (diff) | |
download | numpy-5c02fedbe1585a8e2ae530ec34d44dc80eadd4e5.tar.gz |
BUG: Fix for Python 4
Diffstat (limited to 'numpy/testing/_private/parameterized.py')
-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") |