aboutsummaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorsomov <somov@yandex-team.com>2023-05-18 17:01:07 +0300
committersomov <somov@yandex-team.com>2023-05-18 17:01:07 +0300
commit61480ac2bbf60b1cd0923b45601c210fce3f27cd (patch)
treeaa3834ce0c978c1f2b37f3d10d84432da193bcb1 /library
parent609d4c8138a6605de6fbc333e865b36acdb5cee6 (diff)
downloadydb-61480ac2bbf60b1cd0923b45601c210fce3f27cd.tar.gz
Fix some deprecation warnings
Diffstat (limited to 'library')
-rw-r--r--library/python/strings/strings.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/library/python/strings/strings.py b/library/python/strings/strings.py
index 41957ab40b..4a256bf4c3 100644
--- a/library/python/strings/strings.py
+++ b/library/python/strings/strings.py
@@ -100,7 +100,10 @@ def stringize_deep(x, enc=DEFAULT_ENCODING, relaxed=True):
@library.python.func.memoize()
def locale_encoding():
try:
- loc = locale.getdefaultlocale()[1]
+ if six.PY3:
+ loc = locale.getencoding()
+ else:
+ loc = locale.getdefaultlocale()[1]
if loc:
codecs.lookup(loc)
return loc