commit | 38430e2dffa3fd9d1648681f3b705917631bdc9a | [log] [tgz] |
---|---|---|
author | Victor Stinner <victor.stinner@haypocalc.com> | Thu Aug 19 17:10:18 2010 +0000 |
committer | Victor Stinner <victor.stinner@haypocalc.com> | Thu Aug 19 17:10:18 2010 +0000 |
tree | 29e3b4d324aae125d5468a0eb17253d1e9dc5363 | |
parent | 9802b39c12712e924bed699812756ce5076b77a3 [diff] [blame] |
Fix os.get_exec_path() (code and tests) for python -bb Catch BytesWarning exceptions.
diff --git a/Lib/os.py b/Lib/os.py index 60dc12f..02e8f14 100644 --- a/Lib/os.py +++ b/Lib/os.py
@@ -387,13 +387,13 @@ 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: