Skip to content

Commit eed65ea

Browse files
committed
pythongh-104783: locale.getlocale() calls sys.getfilesystemencoding()
locale.getlocale() always calls sys.getfilesystemencoding(), instead of calling it only once.
1 parent 3907de1 commit eed65ea

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)