Improve error message if the command is not decodable
This commit is contained in:
parent
7e44b6b0c5
commit
398356baaa
|
@ -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)
|
||||
|
|
|
@ -275,6 +275,7 @@ run_command(wchar_t *command, PyCompilerFlags *cf)
|
|||
return ret != 0;
|
||||
|
||||
error:
|
||||
PySys_WriteStderr("Unable to decode the command from the command line:\n");
|
||||
PyErr_Print();
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue