Skip to content

Commit

Permalink
pythongh-111942: Fix test_io test_constructor()
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
vstinner committed Nov 14, 2023
1 parent 0ff6368 commit eac3bf5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Lib/test/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit eac3bf5

Please sign in to comment.