summaryrefslogtreecommitdiff
path: root/pbr/packaging.py
diff options
context:
space:
mode:
authorDoug Hellmann <doug.hellmann@dreamhost.com>2013-08-02 11:46:09 -0400
committerDoug Hellmann <doug.hellmann@dreamhost.com>2013-08-02 13:11:41 -0400
commit8eff471f60a0be2eb6ede5525e224852d5c06048 (patch)
tree8d51ea514114ced5c50fc8c6b6e578f4cb9c627e /pbr/packaging.py
parent9a3b73388713dcd383df3b9a5b0608120f22c35e (diff)
downloadpbr-8eff471f60a0be2eb6ede5525e224852d5c06048.tar.gz
Ensure _run_shell_command always returns same type
If _run_shell_command gets no output, return an empty string instead of None. This ensures that callers can always treat the results as a string, and avoids the TypeError that was preventing the ChangeLog and AUTHORS files from being created properly in a git repository without any commits. Change-Id: I880210bc3ff92ece29b216a10e1d0c918f884eaf
Diffstat (limited to 'pbr/packaging.py')
-rw-r--r--pbr/packaging.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/pbr/packaging.py b/pbr/packaging.py
index 8e6ab4a..366f21e 100644
--- a/pbr/packaging.py
+++ b/pbr/packaging.py
@@ -220,7 +220,7 @@ def _run_shell_command(cmd, throw_on_error=False, buffer=True):
raise distutils.errors.DistutilsError(
"%s returned %d" % (cmd, output.returncode))
if len(out) == 0 or not out[0] or not out[0].strip():
- return None
+ return ''
return out[0].strip().decode('utf-8')