mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Improve error message if the command is not decodable
This commit is contained in:
parent
7e44b6b0c5
commit
398356baaa
2 changed files with 5 additions and 1 deletions
|
@ -509,7 +509,10 @@ class SysModuleTest(unittest.TestCase):
|
|||
p = subprocess.Popen([sys.executable, "-c", code], stderr=subprocess.PIPE)
|
||||
stdout, stderr = p.communicate()
|
||||
self.assertEqual(p.returncode, 1)
|
||||
self.assertIn(br"UnicodeEncodeError:", stderr)
|
||||
lines = stderr.splitlines()
|
||||
self.assertGreaterEqual(len(lines), 2)
|
||||
self.assertEqual(b"Unable to decode the command from the command line:", lines[0])
|
||||
self.assertIn(br"UnicodeEncodeError:", lines[1])
|
||||
|
||||
def test_sys_flags(self):
|
||||
self.assertTrue(sys.flags)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue