mirror of
https://github.com/powerline/powerline.git
synced 2025-04-08 19:25:04 +02:00
Remove usage of deprecated method locale.getdefaultlocale()
Fixes the following deprecation warning: powerline/lib/encoding.py:49: DeprecationWarning: 'locale.getdefaultlocale' is deprecated and slated for removal in Python 3.15. Use setlocale(), getencoding() and getlocale() instead. or locale.getdefaultlocale()[1]
This commit is contained in:
parent
f4f5c61337
commit
dcc4e0e44b
@ -46,12 +46,12 @@ def get_preferred_output_encoding():
|
||||
if hasattr(locale, 'LC_MESSAGES'):
|
||||
return (
|
||||
locale.getlocale(locale.LC_MESSAGES)[1]
|
||||
or locale.getdefaultlocale()[1]
|
||||
or locale.getlocale()[1]
|
||||
or 'ascii'
|
||||
)
|
||||
|
||||
return (
|
||||
locale.getdefaultlocale()[1]
|
||||
locale.getlocale()[1]
|
||||
or 'ascii'
|
||||
)
|
||||
|
||||
@ -66,12 +66,12 @@ def get_preferred_input_encoding():
|
||||
if hasattr(locale, 'LC_MESSAGES'):
|
||||
return (
|
||||
locale.getlocale(locale.LC_MESSAGES)[1]
|
||||
or locale.getdefaultlocale()[1]
|
||||
or locale.getlocale()[1]
|
||||
or 'latin1'
|
||||
)
|
||||
|
||||
return (
|
||||
locale.getdefaultlocale()[1]
|
||||
locale.getlocale()[1]
|
||||
or 'latin1'
|
||||
)
|
||||
|
||||
@ -86,7 +86,7 @@ def get_preferred_arguments_encoding():
|
||||
a problem.
|
||||
'''
|
||||
return (
|
||||
locale.getdefaultlocale()[1]
|
||||
locale.getlocale()[1]
|
||||
or 'latin1'
|
||||
)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user