Show More
@@ -649,15 +649,15 b' def embedded(f, modname, src):' | |||||
649 | ... print("%s %s %d" % (_forcestr(m), _forcestr(f), l)) |
|
649 | ... print("%s %s %d" % (_forcestr(m), _forcestr(f), l)) | |
650 | ... print(repr(_forcestr(s))) |
|
650 | ... print(repr(_forcestr(s))) | |
651 | >>> lines = [ |
|
651 | >>> lines = [ | |
652 |
... |
|
652 | ... 'comment', | |
653 |
... |
|
653 | ... ' >>> from __future__ import print_function', | |
654 |
... |
|
654 | ... " >>> ' multiline", | |
655 |
... |
|
655 | ... " ... string'", | |
656 |
... |
|
656 | ... ' ', | |
657 |
... |
|
657 | ... 'comment', | |
658 |
... |
|
658 | ... ' $ cat > foo.py <<EOF', | |
659 |
... |
|
659 | ... ' > from __future__ import print_function', | |
660 |
... |
|
660 | ... ' > EOF', | |
661 | ... ] |
|
661 | ... ] | |
662 | >>> test(b"example.t", lines) |
|
662 | >>> test(b"example.t", lines) | |
663 | example[2] doctest.py 1 |
|
663 | example[2] doctest.py 1 | |
@@ -694,7 +694,7 b' def sources(f, modname):' | |||||
694 | yield src.read(), modname, f, 0 |
|
694 | yield src.read(), modname, f, 0 | |
695 | py = True |
|
695 | py = True | |
696 | if py or f.endswith('.t'): |
|
696 | if py or f.endswith('.t'): | |
697 |
with open(f, 'r |
|
697 | with open(f, 'r') as src: | |
698 | for script, modname, t, line in embedded(f, modname, src): |
|
698 | for script, modname, t, line in embedded(f, modname, src): | |
699 | yield script, modname.encode('utf8'), t, line |
|
699 | yield script, modname.encode('utf8'), t, line | |
700 |
|
700 |
General Comments 0
You need to be logged in to leave comments.
Login now