summaryrefslogtreecommitdiff
path: root/Lib/os.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2010-08-19 17:10:18 +0000
committerVictor Stinner <victor.stinner@haypocalc.com>2010-08-19 17:10:18 +0000
commit4db9192427b256a01afbdbfc07dc8ab18f48b3cf (patch)
tree7d1d49aa78c4f8b5259267bb607b90c79a093c66 /Lib/os.py
parentd712648107c59b20396db66c4a37294a672ea5e8 (diff)
downloadcpython-4db9192427b256a01afbdbfc07dc8ab18f48b3cf.tar.gz
Fix os.get_exec_path() (code and tests) for python -bb
Catch BytesWarning exceptions.
Diffstat (limited to 'Lib/os.py')
-rw-r--r--Lib/os.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/os.py b/Lib/os.py
index 60dc12fcf2..02e8f14a1e 100644
--- a/Lib/os.py
+++ b/Lib/os.py
@@ -387,13 +387,13 @@ def get_exec_path(env=None):
try:
path_list = env.get('PATH')
- except TypeError:
+ except (TypeError, BytesWarning):
path_list = None
if supports_bytes_environ:
try:
path_listb = env[b'PATH']
- except (KeyError, TypeError):
+ except (KeyError, TypeError, BytesWarning):
pass
else:
if path_list is not None: