Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 221d703

Browse files
authored
gh-104783: locale.getlocale() calls sys.getfilesystemencoding() (#105401)
locale.getlocale() always calls sys.getfilesystemencoding(), instead of calling it only once.
1 parent 2b8e6e5 commit 221d703

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Lib/locale.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -618,9 +618,8 @@ def setlocale(category, locale=None):
618618
except ImportError:
619619
# When _locale.getencoding() is missing, locale.getencoding() uses the
620620
# Python filesystem encoding.
621-
_encoding = sys.getfilesystemencoding()
622621
def getencoding():
623-
return _encoding
622+
return sys.getfilesystemencoding()
624623

625624

626625
try:

0 commit comments

Comments
 (0)