summaryrefslogtreecommitdiff
path: root/coverage/phystokens.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2009-11-15 17:53:24 -0500
committerNed Batchelder <ned@nedbatchelder.com>2009-11-15 17:53:24 -0500
commit9190a4503da8740b69a7912abeb93d46d2bdd959 (patch)
tree6c2c44ac968b630cdd68ca202e9f638ec4a0b834 /coverage/phystokens.py
parent5f113651d3406fc717a1c6ea9c3119726a1a9b4b (diff)
downloadpython-coveragepy-9190a4503da8740b69a7912abeb93d46d2bdd959.tar.gz
Tabs are 8 spaces, as the Python docs dictate. Fixes issue #31.
Diffstat (limited to 'coverage/phystokens.py')
-rw-r--r--coverage/phystokens.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/coverage/phystokens.py b/coverage/phystokens.py
index 7eebb8a..2862490 100644
--- a/coverage/phystokens.py
+++ b/coverage/phystokens.py
@@ -71,7 +71,7 @@ def source_token_lines(source):
ws_tokens = [token.INDENT, token.DEDENT, token.NEWLINE, tokenize.NL]
line = []
col = 0
- tokgen = tokenize.generate_tokens(StringIO(source).readline)
+ tokgen = tokenize.generate_tokens(StringIO(source.expandtabs(8)).readline)
for ttype, ttext, (_, scol), (_, ecol), _ in phys_tokens(tokgen):
mark_start = True
for part in re.split('(\n)', ttext):