summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_os.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2010-10-29 00:38:58 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2010-10-29 00:38:58 (GMT)
commit6f35eda4d9973acf573c14fee0042f8ceef9fce0 (patch)
treee3e1883596e5a59c40a10f3b0b21f5a73cd3ba1d /Lib/test/test_os.py
parentbfd7b265b6e14c6e64e0f1fad9c9df5bb54d8f18 (diff)
downloadcpython-6f35eda4d9973acf573c14fee0042f8ceef9fce0.zip
cpython-6f35eda4d9973acf573c14fee0042f8ceef9fce0.tar.gz
cpython-6f35eda4d9973acf573c14fee0042f8ceef9fce0.tar.bz2
Issue #10210: os.get_exec_path() ignores BytesWarning warnings
Diffstat (limited to 'Lib/test/test_os.py')
-rw-r--r--Lib/test/test_os.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py
index e413e1f..73261e0 100644
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -461,8 +461,11 @@ class EnvironTests(mapping_tests.BasicTestMappingProtocol):
if os.supports_bytes_environ:
# env cannot contain 'PATH' and b'PATH' keys
try:
- mixed_env = {'PATH': '1', b'PATH': b'2'}
+ # ignore BytesWarning warning
+ with warnings.catch_warnings(record=True):
+ mixed_env = {'PATH': '1', b'PATH': b'2'}
except BytesWarning:
+ # mixed_env cannot be created with python -bb
pass
else:
self.assertRaises(ValueError, os.get_exec_path, mixed_env)