mirror of
https://github.com/asciinema/asciinema.git
synced 2025-12-16 19:58:03 +01:00
Address mypy's typing concerns
This commit is contained in:
@@ -13,13 +13,18 @@ from .commands.upload import UploadCommand
|
|||||||
|
|
||||||
|
|
||||||
def valid_encoding() -> bool:
|
def valid_encoding() -> bool:
|
||||||
def _locales() -> str:
|
def _locales() -> Optional[str]:
|
||||||
try:
|
try:
|
||||||
return locale.nl_langinfo(locale.CODESET)
|
return locale.nl_langinfo(locale.CODESET)
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
return locale.getlocale()[-1]
|
return locale.getlocale()[-1]
|
||||||
|
|
||||||
return _locales().upper() in ("US-ASCII", "UTF-8", "UTF8")
|
loc = _locales()
|
||||||
|
|
||||||
|
if loc is None:
|
||||||
|
return False
|
||||||
|
else:
|
||||||
|
return loc.upper() in ("US-ASCII", "UTF-8", "UTF8")
|
||||||
|
|
||||||
|
|
||||||
def positive_int(value: str) -> int:
|
def positive_int(value: str) -> int:
|
||||||
|
|||||||
Reference in New Issue
Block a user