From eac3bf5f784790dee0ffc8951124d5d963e9d930 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Tue, 14 Nov 2023 19:10:55 +0100 Subject: [PATCH] gh-111942: Fix test_io test_constructor() The error handler is not tested in the _io extension. It's only tested if Python is built in debug mode (Py_DEBUG) or if the Python Development Mode (-X dev) is enabled. --- Lib/test/test_io.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py index fe622e836ddac2..2f04fee39ab3fa 100644 --- a/Lib/test/test_io.py +++ b/Lib/test/test_io.py @@ -2722,7 +2722,7 @@ def test_constructor(self): t.__init__(b, encoding='utf-8\0') with self.assertRaises(invalid_type): t.__init__(b, encoding="utf-8", errors=42) - if support.Py_DEBUG or sys.flags.dev_mode or self.is_C: + if support.Py_DEBUG or sys.flags.dev_mode: with self.assertRaises(UnicodeEncodeError): t.__init__(b, encoding="utf-8", errors='\udcfe') if support.Py_DEBUG or sys.flags.dev_mode: