diff options
author | Jon Dufresne <jon.dufresne@gmail.com> | 2020-01-05 00:53:30 -0500 |
---|---|---|
committer | Warren Weckesser <warren.weckesser@gmail.com> | 2020-01-05 00:53:30 -0500 |
commit | c31cc36a8a814ed4844a2a553454185601914a5a (patch) | |
tree | adb28a762dc0985eed669db75b564b3f5c3bfbcc /numpy/distutils/tests/test_exec_command.py | |
parent | c1f1bc9ce8e4e2936e80d9bfafc3d8e03237a84b (diff) | |
download | numpy-c31cc36a8a814ed4844a2a553454185601914a5a.tar.gz |
MAINT: Remove implicit inheritance from object class (#15236)
Inheriting from object was necessary for Python 2 compatibility to use
new-style classes. In Python 3, this is unnecessary as there are no
old-style classes.
Dropping the object is more idiomatic Python.
Diffstat (limited to 'numpy/distutils/tests/test_exec_command.py')
-rw-r--r-- | numpy/distutils/tests/test_exec_command.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/numpy/distutils/tests/test_exec_command.py b/numpy/distutils/tests/test_exec_command.py index 8c3a4516a..2ac0a6308 100644 --- a/numpy/distutils/tests/test_exec_command.py +++ b/numpy/distutils/tests/test_exec_command.py @@ -13,7 +13,7 @@ if sys.version_info[0] >= 3: else: from StringIO import StringIO -class redirect_stdout(object): +class redirect_stdout: """Context manager to redirect stdout for exec_command test.""" def __init__(self, stdout=None): self._stdout = stdout or sys.stdout @@ -28,7 +28,7 @@ class redirect_stdout(object): # note: closing sys.stdout won't close it. self._stdout.close() -class redirect_stderr(object): +class redirect_stderr: """Context manager to redirect stderr for exec_command test.""" def __init__(self, stderr=None): self._stderr = stderr or sys.stderr @@ -43,7 +43,7 @@ class redirect_stderr(object): # note: closing sys.stderr won't close it. self._stderr.close() -class emulate_nonposix(object): +class emulate_nonposix: """Context manager to emulate os.name != 'posix' """ def __init__(self, osname='non-posix'): self._new_name = osname @@ -96,7 +96,7 @@ def test_exec_command_stderr(): exec_command.exec_command("cd '.'") -class TestExecCommand(object): +class TestExecCommand: def setup(self): self.pyexe = get_pythonexe() |