summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2015-10-25 11:56:13 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2015-10-25 11:56:13 -0400
commit2e3e9748d46fef423bae36bd4f5d94e38f66f85c (patch)
treebc07a05802a2e0d44826324803b11505a0830074
parent718cefefcdcbd916bcd24f9d2d8f0d927cbc6342 (diff)
downloadpython-systemd-2e3e9748d46fef423bae36bd4f5d94e38f66f85c.tar.gz
build-sys: replace loop with list comprehension
-rw-r--r--setup.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/setup.py b/setup.py
index 742deb8..d18090b 100644
--- a/setup.py
+++ b/setup.py
@@ -7,11 +7,9 @@ from subprocess import Popen, PIPE, check_output
class build_ext_generate_id128_header(build_ext):
def run(self):
if not self.dry_run and not os.path.exists("systemd/id128-constants.h"):
- constants = []
- with open("/usr/include/systemd/sd-messages.h") as f:
- for line in f:
- if line.startswith('#define SD'):
- constants.append(line.split()[1])
+ constants = [line.split()[1]
+ for line in open("/usr/include/systemd/sd-messages.h")
+ if line.startswith('#define SD_MESSAGE_')]
with open("systemd/id128-constants.h", "w") as f:
for c in constants: