diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2013-10-19 22:08:37 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2013-10-19 22:08:37 -0400 |
commit | bad63e02b113626a048ea5eb253293c61902e291 (patch) | |
tree | efb98eaafdf9d9212b53a1e51a782f7ff00cca41 /coverage/parser.py | |
parent | b3df60a544a54b4dd604d34137ff08e02b815e81 (diff) | |
download | python-coveragepy-git-bad63e02b113626a048ea5eb253293c61902e291.tar.gz |
Generator expressons are ok now.
--HG--
branch : 4.0
Diffstat (limited to 'coverage/parser.py')
-rw-r--r-- | coverage/parser.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/coverage/parser.py b/coverage/parser.py index 0873e7af..010cd73a 100644 --- a/coverage/parser.py +++ b/coverage/parser.py @@ -365,7 +365,7 @@ class ByteParser(object): """ children = CodeObjects(self.code) - return [ByteParser(code=c, text=self.text) for c in children] + return (ByteParser(code=c, text=self.text) for c in children) def _bytes_lines(self): """Map byte offsets to line numbers in `code`. @@ -409,7 +409,7 @@ class ByteParser(object): def _block_stack_repr(self, block_stack): """Get a string version of `block_stack`, for debugging.""" blocks = ", ".join( - ["(%s, %r)" % (dis.opname[b[0]], b[1]) for b in block_stack] + "(%s, %r)" % (dis.opname[b[0]], b[1]) for b in block_stack ) return "[" + blocks + "]" @@ -547,9 +547,9 @@ class ByteParser(object): def validate_chunks(self, chunks): """Validate the rule that chunks have a single entrance.""" # starts is the entrances to the chunks - starts = set([ch.byte for ch in chunks]) + starts = set(ch.byte for ch in chunks) for ch in chunks: - assert all([(ex in starts or ex < 0) for ex in ch.exits]) + assert all((ex in starts or ex < 0) for ex in ch.exits) def _arcs(self): """Find the executable arcs in the code. @@ -562,7 +562,7 @@ class ByteParser(object): chunks = self._split_into_chunks() # A map from byte offsets to chunks jumped into. - byte_chunks = dict([(c.byte, c) for c in chunks]) + byte_chunks = dict((c.byte, c) for c in chunks) # There's always an entrance at the first chunk. yield (-1, byte_chunks[0].line) |