[Python-checkins] cpython (3.4): revert 7b833bd1f509. I misread the side effect that the code was triggering.

gregory.p.smith python-checkins at python.org
Fri Jan 23 07:56:22 CET 2015


https://hg.python.org/cpython/rev/31982d70a52a
changeset:   94251:31982d70a52a
branch:      3.4
parent:      94249:7b833bd1f509
user:        Gregory P. Smith <greg at krypto.org>
date:        Thu Jan 22 22:55:00 2015 -0800
summary:
  revert 7b833bd1f509.  I misread the side effect that the code was triggering.
*any* kwarg supplied to _assert_python causes it to not append -E to the
command line flags so without='-E' does effectively work.

files:
  Lib/test/test_cmd_line.py |  6 ++++--
  1 files changed, 4 insertions(+), 2 deletions(-)


diff --git a/Lib/test/test_cmd_line.py b/Lib/test/test_cmd_line.py
--- a/Lib/test/test_cmd_line.py
+++ b/Lib/test/test_cmd_line.py
@@ -426,11 +426,13 @@
         self.assertIn(b'Unknown option: -z', err)
         self.assertEqual(err.splitlines().count(b'Unknown option: -z'), 1)
         self.assertEqual(b'', out)
-        rc, out, err = assert_python_failure('-z')
+        # Add "without='-E'" to prevent _assert_python to append -E
+        # to env_vars and change the output of stderr
+        rc, out, err = assert_python_failure('-z', without='-E')
         self.assertIn(b'Unknown option: -z', err)
         self.assertEqual(err.splitlines().count(b'Unknown option: -z'), 1)
         self.assertEqual(b'', out)
-        rc, out, err = assert_python_failure('-a', '-z')
+        rc, out, err = assert_python_failure('-a', '-z', without='-E')
         self.assertIn(b'Unknown option: -a', err)
         # only the first unknown option is reported
         self.assertNotIn(b'Unknown option: -z', err)

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list