gh-104783: locale.getlocale() calls sys.getfilesystemencoding() (#105401)

locale.getlocale() always calls sys.getfilesystemencoding(), instead
of calling it only once.
This commit is contained in:
Victor Stinner 2023-06-06 20:19:40 +02:00 committed by GitHub
parent 2b8e6e5712
commit 221d703498
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -618,9 +618,8 @@ try:
except ImportError:
# When _locale.getencoding() is missing, locale.getencoding() uses the
# Python filesystem encoding.
_encoding = sys.getfilesystemencoding()
def getencoding():
return _encoding
return sys.getfilesystemencoding()
try: