aboutsummaryrefslogtreecommitdiffstats
path: root/git_deps
diff options
context:
space:
mode:
Diffstat (limited to 'git_deps')
-rw-r--r--git_deps/detector.py4
-rw-r--r--git_deps/gitutils.py8
-rw-r--r--git_deps/listener/cli.py2
3 files changed, 8 insertions, 6 deletions
diff --git a/git_deps/detector.py b/git_deps/detector.py
index 3111a38..df5b001 100644
--- a/git_deps/detector.py
+++ b/git_deps/detector.py
@@ -169,7 +169,7 @@ class DependencyDetector(object):
'-L', "%d,+%d" % (hunk.old_start, hunk.old_lines),
parent.hex, '--', path
]
- blame = subprocess.check_output(cmd)
+ blame = subprocess.check_output(cmd, universal_newlines=True)
dependent_sha1 = dependent.hex
if dependent_sha1 not in self.dependencies:
@@ -288,7 +288,7 @@ class DependencyDetector(object):
cmd = ['git', 'merge-base', sha1, branch_sha1]
# self.logger.debug(" ".join(cmd))
- out = subprocess.check_output(cmd).strip()
+ out = subprocess.check_output(cmd, universal_newlines=True).strip()
self.logger.debug(" merge-base returned: %s" % out[:8])
result = out == sha1
self.logger.debug(" %s" % result)
diff --git a/git_deps/gitutils.py b/git_deps/gitutils.py
index f7b5470..f699551 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).strip()
+ out = subprocess.check_output(cmd, universal_newlines=True).strip()
# cls.logger.debug(out)
return out
@@ -39,7 +39,8 @@ class GitUtils(object):
# cls.logger.debug(" ".join(cmd))
out = None
try:
- out = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
+ out = subprocess.check_output(
+ cmd, stderr=subprocess.STDOUT, universal_newlines=True)
except subprocess.CalledProcessError as e:
if e.output.find('No tags can describe') != -1:
return ''
@@ -77,7 +78,8 @@ class GitUtils(object):
@classmethod
def rev_list(cls, rev_range):
cmd = ['git', 'rev-list', rev_range]
- return subprocess.check_output(cmd).strip().split('\n')
+ return subprocess.check_output(cmd, universal_newlines=True) \
+ .strip().split('\n')
@classmethod
def ref_commit(cls, repo, rev):
diff --git a/git_deps/listener/cli.py b/git_deps/listener/cli.py
index 285c622..01bf4df 100644
--- a/git_deps/listener/cli.py
+++ b/git_deps/listener/cli.py
@@ -46,7 +46,7 @@ class CLIDependencyListener(DependencyListener):
'log', '-n1',
dependency_sha1
]
- print(subprocess.check_output(cmd))
+ print(subprocess.check_output(cmd, universal_newlines=True))
# dependency = detector.get_commit(dependency_sha1)
# print(dependency.message + "\n")