aboutsummaryrefslogtreecommitdiffstats
path: root/build/scripts/generate_vcs_info.py
diff options
context:
space:
mode:
authorsnermolaev <snermolaev@yandex-team.com>2024-02-20 21:10:19 +0300
committersnermolaev <snermolaev@yandex-team.com>2024-02-20 21:21:29 +0300
commitb1d06a80e195c1e6c85f6b872ec928dc13f8a206 (patch)
tree72effb1eae525b4d6956f47e4513df1483b1def8 /build/scripts/generate_vcs_info.py
parent8065c59730904622802eda4947edf05c9e7c837b (diff)
downloadydb-b1d06a80e195c1e6c85f6b872ec928dc13f8a206.tar.gz
get rid of six
faeb2c69960c197db9fc9c5d0696d6dc0ce3d74a
Diffstat (limited to 'build/scripts/generate_vcs_info.py')
-rw-r--r--build/scripts/generate_vcs_info.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/build/scripts/generate_vcs_info.py b/build/scripts/generate_vcs_info.py
index b311be5617..b1ccdfcf9c 100644
--- a/build/scripts/generate_vcs_info.py
+++ b/build/scripts/generate_vcs_info.py
@@ -6,7 +6,6 @@ import os
import subprocess
import sys
import time
-import six as six_
INDENT = " " * 4
@@ -21,10 +20,7 @@ def _get_vcs_dictionary(vcs_type, *arg):
def _get_user_locale():
try:
- if six_.PY3:
- return [locale.getencoding()]
- else:
- return [locale.getdefaultlocale()[1]]
+ return [locale.getencoding()]
except Exception:
return []
@@ -116,7 +112,7 @@ class _GitVersion:
except Exception:
branch_info = [''.encode('utf-8')]
- depth = six_.text_type(_GitVersion._get_git_depth(env, arc_root)).encode('utf-8')
+ depth = str(_GitVersion._get_git_depth(env, arc_root)).encode('utf-8')
# logger.debug('Git info commit:{}, author:{}, summary:{}, svn_id:{}'.format(commit, author, summary, svn_id))
return [commit, author, summary, svn_id, tag_info[0], branch_info[0], depth]
@@ -175,7 +171,7 @@ class _SystemInfo:
@staticmethod
def _to_text(s):
- if isinstance(s, six_.binary_type):
+ if isinstance(s, bytes):
return s.decode(_SystemInfo.get_locale(), errors='replace')
return s
@@ -239,7 +235,7 @@ class _SystemInfo:
try:
import ctypes
- msg = six_.text_type(ctypes.FormatError(e.winerror), _SystemInfo.get_locale()).encode('utf-8')
+ msg = str(ctypes.FormatError(e.winerror), _SystemInfo.get_locale()).encode('utf-8')
except ImportError:
pass
# logger.debug('System command call {} failed [{}]: {}\n'.format(command, errcodes, msg))