Use a module level constant as best practice (#10876)

This commit is contained in:
danieleades 2022-09-29 19:07:29 +01:00 committed by GitHub
parent 3c73efadab
commit 6e113d4e90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -159,8 +159,11 @@ def setlocale(category: int, value: Union[str, Iterable[str], None] = None) -> N
pass
_LOCALE_DIR = path.abspath(path.dirname(__file__))
def init_console(
locale_dir: str = path.abspath(path.dirname(__file__)), # NoQA: B008
locale_dir: str = _LOCALE_DIR,
catalog: str = 'sphinx',
) -> Tuple[NullTranslations, bool]:
"""Initialize locale for console.