From 9d7b919c7de45ff81ea52bb289a8e4bd192b1c27 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Sat, 7 Sep 2019 16:48:27 -0700 Subject: [PATCH] Fix pypy3.6 on windows --- changelog/5807.bugfix.rst | 1 + src/_pytest/capture.py | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 changelog/5807.bugfix.rst diff --git a/changelog/5807.bugfix.rst b/changelog/5807.bugfix.rst new file mode 100644 index 000000000..bfa0ffbcf --- /dev/null +++ b/changelog/5807.bugfix.rst @@ -0,0 +1 @@ +Fix pypy3.6 (nightly) on windows. diff --git a/src/_pytest/capture.py b/src/_pytest/capture.py index f89aaefba..e4e58b32c 100644 --- a/src/_pytest/capture.py +++ b/src/_pytest/capture.py @@ -789,7 +789,11 @@ def _py36_windowsconsoleio_workaround(stream): See https://github.com/pytest-dev/py/issues/103 """ - if not sys.platform.startswith("win32") or sys.version_info[:2] < (3, 6): + if ( + not sys.platform.startswith("win32") + or sys.version_info[:2] < (3, 6) + or hasattr(sys, "pypy_version_info") + ): return # bail out if ``stream`` doesn't seem like a proper ``io`` stream (#2666)