diff options
| author | Serhiy Storchaka <storchaka@gmail.com> | 2024-02-04 15:27:42 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-04 15:27:42 (GMT) |
| commit | ecabff98c41453f15ecd26ac255d531b571b9bc1 (patch) | |
| tree | 901c196e66150cc59acbab36d7906bf603c6966e /Lib/unittest/result.py | |
| parent | ca715e56a13feabc15c368898df6511613d18987 (diff) | |
| download | cpython-ecabff98c41453f15ecd26ac255d531b571b9bc1.zip cpython-ecabff98c41453f15ecd26ac255d531b571b9bc1.tar.gz cpython-ecabff98c41453f15ecd26ac255d531b571b9bc1.tar.bz2 | |
gh-113267: Revert "gh-106584: Fix exit code for unittest in Python 3.12 (#106588)" (GH-114470)
This reverts commit 8fc071345b50dd3de61ebeeaa287ccef21d061b2.
Diffstat (limited to 'Lib/unittest/result.py')
| -rw-r--r-- | Lib/unittest/result.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/Lib/unittest/result.py b/Lib/unittest/result.py index 9e56f65..3ace0a5 100644 --- a/Lib/unittest/result.py +++ b/Lib/unittest/result.py @@ -97,12 +97,10 @@ class TestResult(object): sys.stdout = self._original_stdout sys.stderr = self._original_stderr - if self._stdout_buffer is not None: - self._stdout_buffer.seek(0) - self._stdout_buffer.truncate() - if self._stderr_buffer is not None: - self._stderr_buffer.seek(0) - self._stderr_buffer.truncate() + self._stdout_buffer.seek(0) + self._stdout_buffer.truncate() + self._stderr_buffer.seek(0) + self._stderr_buffer.truncate() def stopTestRun(self): """Called once after all tests are executed. |
