diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2017-04-05 06:37:24 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-05 06:37:24 (GMT) |
commit | 5affd23e6f42125998724787025080a24839266e (patch) | |
tree | 8b7ca82362e78a32805b117d574082d512251d3c /Lib/locale.py | |
parent | 43ba8861e0ad044efafa46a7cc04e12ac5df640e (diff) | |
download | cpython-5affd23e6f42125998724787025080a24839266e.zip cpython-5affd23e6f42125998724787025080a24839266e.tar.gz cpython-5affd23e6f42125998724787025080a24839266e.tar.bz2 |
bpo-29762: More use "raise from None". (#569)
This hides unwanted implementation details from tracebacks.
Diffstat (limited to 'Lib/locale.py')
-rw-r--r-- | Lib/locale.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/locale.py b/Lib/locale.py index 73fc94d..5763b14 100644 --- a/Lib/locale.py +++ b/Lib/locale.py @@ -512,7 +512,8 @@ def _build_localename(localetuple): else: return language + '.' + encoding except (TypeError, ValueError): - raise TypeError('Locale must be None, a string, or an iterable of two strings -- language code, encoding.') + raise TypeError('Locale must be None, a string, or an iterable of ' + 'two strings -- language code, encoding.') from None def getdefaultlocale(envvars=('LC_ALL', 'LC_CTYPE', 'LANG', 'LANGUAGE')): |