Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TYP/REF: remove mypy ignore from localization.py #47240

Merged
merged 2 commits into from
Jun 6, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions pandas/_config/localization.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 f"{normalized_code}.{normalized_encoding}"
else:
yield new_locale
finally:
Expand Down