##// END OF EJS Templates
contrib: fix import-checker to operate on str instead of bytes...
Augie Fackler -
r42580:04eb3c56 default
parent child Browse files
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 ... b'comment',
652 ... 'comment',
653 ... b' >>> from __future__ import print_function',
653 ... ' >>> from __future__ import print_function',
654 ... b" >>> ' multiline",
654 ... " >>> ' multiline",
655 ... b" ... string'",
655 ... " ... string'",
656 ... b' ',
656 ... ' ',
657 ... b'comment',
657 ... 'comment',
658 ... b' $ cat > foo.py <<EOF',
658 ... ' $ cat > foo.py <<EOF',
659 ... b' > from __future__ import print_function',
659 ... ' > from __future__ import print_function',
660 ... b' > EOF',
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, 'rb') as src:
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