comparison tests/f @ 49873:e9d06ed64161

tests: drop py2 support from `f` utility
author Matt Harbison <matt_harbison@yahoo.com>
date Tue, 03 Jan 2023 23:49:05 -0500
parents 9172bd49cedc
children
comparison
equal deleted inserted replaced
49872:40060267df22 49873:e9d06ed64161
30 import optparse 30 import optparse
31 import os 31 import os
32 import re 32 import re
33 import sys 33 import sys
34 34
35 # Python 3 adapters 35
36 ispy3 = sys.version_info[0] >= 3 36 def iterbytes(s):
37 if ispy3: 37 for i in range(len(s)):
38 38 yield s[i : i + 1]
39 def iterbytes(s):
40 for i in range(len(s)):
41 yield s[i : i + 1]
42
43
44 else:
45 iterbytes = iter
46 39
47 40
48 def visit(opts, filenames, outfile): 41 def visit(opts, filenames, outfile):
49 """Process filenames in the way specified in opts, writing output to 42 """Process filenames in the way specified in opts, writing output to
50 outfile.""" 43 outfile."""