summaryrefslogtreecommitdiffstats
path: root/openstack/common/setup.py
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-05-13 20:44:18 +0000
committerGerrit Code Review <review@openstack.org>2013-05-13 20:44:18 +0000
commit3e336928cbd5caa689d04e40786607cbb90f3ec0 (patch)
treebc02694debf6f278930b7f0835f300d5999b0f74 /openstack/common/setup.py
parent670c68f7a14fd3be918ce9dc2a663913fe27a37e (diff)
parenta51469326e84ed977ecc4e57fd3d46cdc21aa08f (diff)
downloadoslo-3e336928cbd5caa689d04e40786607cbb90f3ec0.tar.gz
oslo-3e336928cbd5caa689d04e40786607cbb90f3ec0.tar.xz
oslo-3e336928cbd5caa689d04e40786607cbb90f3ec0.zip
Merge "Removes len() on empty sequence evaluation"
Diffstat (limited to 'openstack/common/setup.py')
-rw-r--r--openstack/common/setup.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/openstack/common/setup.py b/openstack/common/setup.py
index 03b0675..1b3a127 100644
--- a/openstack/common/setup.py
+++ b/openstack/common/setup.py
@@ -127,11 +127,9 @@ def _run_shell_command(cmd, throw_on_error=False):
out = output.communicate()
if output.returncode and throw_on_error:
raise Exception("%s returned %d" % cmd, output.returncode)
- if len(out) == 0:
+ if not out:
return None
- if len(out[0].strip()) == 0:
- return None
- return out[0].strip()
+ return out[0].strip() or None
def _get_git_directory():