[py-svn] pytest commit 43dccff20598: replace with list comp

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Sun Nov 7 00:33:42 CET 2010


# HG changeset patch -- Bitbucket.org
# Project pytest
# URL http://bitbucket.org/hpk42/pytest/overview
# User Benjamin Peterson <benjamin at python.org>
# Date 1289086440 18000
# Node ID 43dccff205987b4737e5d8c4fa077224f38b78c0
# Parent  1df9ce97afeb503b2114f2de77684f7e88297537
replace with list comp

--- a/pytest/plugin/config.py
+++ b/pytest/plugin/config.py
@@ -376,7 +376,7 @@ class Config(object):
         elif type == "args":
             return py.std.shlex.split(value)
         elif type == "linelist":
-            return filter(None, map(lambda x: x.strip(), value.split("\n")))
+            return [t for t in map(lambda x: x.strip(), value.split("\n")) if t]
         else:
             assert type is None
             return value



More information about the pytest-commit mailing list