From 49c2356658bd6dd31c9883c342197abfb457c370 Mon Sep 17 00:00:00 2001 From: Thierry Moisan Date: Sun, 5 Jun 2022 11:42:47 -0400 Subject: [PATCH 1/2] TYP: remove mypy ignore from localization.py --- pandas/_config/localization.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pandas/_config/localization.py b/pandas/_config/localization.py index 2e1ef31033d71..cff93bb27f48c 100644 --- a/pandas/_config/localization.py +++ b/pandas/_config/localization.py @@ -43,11 +43,9 @@ def set_locale( try: locale.setlocale(lc_var, new_locale) - normalized_locale = locale.getlocale() - if all(x is not None for x in normalized_locale): - # error: Argument 1 to "join" of "str" has incompatible type - # "Tuple[Optional[str], Optional[str]]"; expected "Iterable[str]" - yield ".".join(normalized_locale) # type: ignore[arg-type] + normalized_code, normalized_encoding = locale.getlocale() + if normalized_code is not None and normalized_encoding is not None: + yield ".".join((normalized_code, normalized_encoding)) else: yield new_locale finally: From 2ba25c339cfc61cb31c2cf23017e2f1c7e1b7712 Mon Sep 17 00:00:00 2001 From: Thierry Moisan Date: Sun, 5 Jun 2022 21:29:21 -0400 Subject: [PATCH 2/2] fixup! TYP: remove mypy ignore from localization.py --- pandas/_config/localization.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/_config/localization.py b/pandas/_config/localization.py index cff93bb27f48c..fa5503029fd4b 100644 --- a/pandas/_config/localization.py +++ b/pandas/_config/localization.py @@ -45,7 +45,7 @@ def set_locale( locale.setlocale(lc_var, new_locale) normalized_code, normalized_encoding = locale.getlocale() if normalized_code is not None and normalized_encoding is not None: - yield ".".join((normalized_code, normalized_encoding)) + yield f"{normalized_code}.{normalized_encoding}" else: yield new_locale finally: