mirror of
https://github.com/python/cpython.git
synced 2025-07-24 03:35:53 +00:00
Issue #23016: A warning no longer produces AttributeError when the program
is run with pythonw.exe.
This commit is contained in:
parent
82c05a54a2
commit
60599525c5
3 changed files with 15 additions and 0 deletions
|
@ -631,6 +631,15 @@ class _WarningsTests(BaseTest, unittest.TestCase):
|
|||
finally:
|
||||
globals_dict['__file__'] = oldfile
|
||||
|
||||
def test_stderr_none(self):
|
||||
rc, stdout, stderr = assert_python_ok("-c",
|
||||
"import sys; sys.stderr = None; "
|
||||
"import warnings; warnings.simplefilter('always'); "
|
||||
"warnings.warn('Warning!')")
|
||||
self.assertEqual(stdout, b'')
|
||||
self.assertNotIn(b'Warning!', stderr)
|
||||
self.assertNotIn(b'Error', stderr)
|
||||
|
||||
|
||||
class WarningsDisplayTests(BaseTest):
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue