Commit 45483fd1 authored by cclauss's avatar cclauss Committed by GitHub

file() was removed in Python 3, use open() instead

http://python-future.org/compatible_idioms.html#file
parent 5ab8ae75
...@@ -35,7 +35,6 @@ This is sort of like comm(1), except it recognizes comments and ignores them. ...@@ -35,7 +35,6 @@ This is sort of like comm(1), except it recognizes comments and ignores them.
""" """
import argparse import argparse
import fileinput
parser = argparse.ArgumentParser( parser = argparse.ArgumentParser(
description='Adds/removes failures from the failure list.') description='Adds/removes failures from the failure list.')
...@@ -62,7 +61,8 @@ for remove_file in (args.remove_list or []): ...@@ -62,7 +61,8 @@ for remove_file in (args.remove_list or []):
add_list = sorted(add_set, reverse=True) add_list = sorted(add_set, reverse=True)
existing_list = file(args.filename).read() with open(args.filename) as in_file:
existing_list = in_file.read()
with open(args.filename, "w") as f: with open(args.filename, "w") as f:
for line in existing_list.splitlines(True): for line in existing_list.splitlines(True):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment