Apply modernize transform libmodernize.fixes.fix_file.

This replaces use of file() with open() which is python 3 compatible,
and also adds it to our python 3 support test suite.
This commit is contained in:
Tim Abbott
2015-10-14 16:31:08 -04:00
parent 83dd51dcd6
commit 700055c194
13 changed files with 20 additions and 19 deletions

View File

@@ -12,7 +12,7 @@ from zerver.lib.user_agent import parse_user_agent
user_agents_parsed = defaultdict(int)
user_agents_path = os.path.join(os.path.dirname(__file__), "user_agents_unique")
parse_errors = 0
for line in file(user_agents_path).readlines():
for line in open(user_agents_path).readlines():
line = line.strip()
match = re.match('^(?P<count>[0-9]+) "(?P<user_agent>.*)"$', line)
if match is None: