mirror of
https://github.com/powerline/powerline.git
synced 2025-07-31 01:35:40 +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'):
|
if hasattr(locale, 'LC_MESSAGES'):
|
||||||
return (
|
return (
|
||||||
locale.getlocale(locale.LC_MESSAGES)[1]
|
locale.getlocale(locale.LC_MESSAGES)[1]
|
||||||
or locale.getdefaultlocale()[1]
|
or locale.getlocale()[1]
|
||||||
or 'ascii'
|
or 'ascii'
|
||||||
)
|
)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
locale.getdefaultlocale()[1]
|
locale.getlocale()[1]
|
||||||
or 'ascii'
|
or 'ascii'
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -66,12 +66,12 @@ def get_preferred_input_encoding():
|
|||||||
if hasattr(locale, 'LC_MESSAGES'):
|
if hasattr(locale, 'LC_MESSAGES'):
|
||||||
return (
|
return (
|
||||||
locale.getlocale(locale.LC_MESSAGES)[1]
|
locale.getlocale(locale.LC_MESSAGES)[1]
|
||||||
or locale.getdefaultlocale()[1]
|
or locale.getlocale()[1]
|
||||||
or 'latin1'
|
or 'latin1'
|
||||||
)
|
)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
locale.getdefaultlocale()[1]
|
locale.getlocale()[1]
|
||||||
or 'latin1'
|
or 'latin1'
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -86,7 +86,7 @@ def get_preferred_arguments_encoding():
|
|||||||
a problem.
|
a problem.
|
||||||
'''
|
'''
|
||||||
return (
|
return (
|
||||||
locale.getdefaultlocale()[1]
|
locale.getlocale()[1]
|
||||||
or 'latin1'
|
or 'latin1'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user