bpo-29762: More use "raise from None". (#569)
This hides unwanted implementation details from tracebacks.
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 @@
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')):