aboutsummaryrefslogtreecommitdiffstats
path: root/git_deps/gitutils.py
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@cepl.eu>2024-04-29 11:18:23 +0200
committerMatěj Cepl <mcepl@cepl.eu>2024-04-29 11:18:23 +0200
commit5d7cdc707996d44ce7d96dab173554117a1aec71 (patch)
treeb27656074556eb099c254bcef332187c1a403a06 /git_deps/gitutils.py
parent5c184b6772b4c9be2a12c6522da66a765f650553 (diff)
downloadgit-deps-5d7cdc707996d44ce7d96dab173554117a1aec71.tar.gz
Set encoding to 'utf-8' explicitly, don't use deprecated universal_newlines parameter.py2k_encoding
Diffstat (limited to 'git_deps/gitutils.py')
-rw-r--r--git_deps/gitutils.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/git_deps/gitutils.py b/git_deps/gitutils.py
index 47355d2..8e0718c 100644
--- a/git_deps/gitutils.py
+++ b/git_deps/gitutils.py
@@ -15,7 +15,7 @@ class GitUtils(object):
# we will be able to do this via pygit2.
cmd = ['git', 'rev-parse', '--short', sha1]
# cls.logger.debug(" ".join(cmd))
- out = subprocess.check_output(cmd, universal_newlines=True).strip()
+ out = subprocess.check_output(cmd, encoding='utf-8').strip()
# cls.logger.debug(out)
return out
@@ -40,7 +40,7 @@ class GitUtils(object):
out = None
try:
out = subprocess.check_output(
- cmd, stderr=subprocess.STDOUT, universal_newlines=True)
+ cmd, stderr=subprocess.STDOUT, encoding='utf-8')
except subprocess.CalledProcessError as e:
if e.output.find('No tags can describe') != -1:
return ''
@@ -82,7 +82,7 @@ class GitUtils(object):
@classmethod
def rev_list(cls, rev_range):
cmd = ['git', 'rev-list', rev_range]
- return subprocess.check_output(cmd, universal_newlines=True) \
+ return subprocess.check_output(cmd, encoding='utf-8') \
.strip().split('\n')
@classmethod