diff options
author | Doug Hellmann <doug.hellmann@dreamhost.com> | 2013-08-02 11:46:09 -0400 |
---|---|---|
committer | Doug Hellmann <doug.hellmann@dreamhost.com> | 2013-08-02 13:11:41 -0400 |
commit | 8eff471f60a0be2eb6ede5525e224852d5c06048 (patch) | |
tree | 8d51ea514114ced5c50fc8c6b6e578f4cb9c627e /pbr/packaging.py | |
parent | 9a3b73388713dcd383df3b9a5b0608120f22c35e (diff) | |
download | pbr-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.py | 2 |
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') |