[regtool] Remove unnecessary 'with'
Since we're using argparse to get us a file object already, this
construct doesn't do very much (technically, it closes the file at the
end of the lexical block, but that doesn't really help here).
Signed-off-by: Rupert Swarbrick <rswarbrick@lowrisc.org>
diff --git a/util/regtool.py b/util/regtool.py
index 9794ee8..764bbdc 100755
--- a/util/regtool.py
+++ b/util/regtool.py
@@ -178,14 +178,13 @@
gen_selfdoc.document(outfile)
exit(0)
- with infile:
- try:
- srcfull = infile.read()
- obj = hjson.loads(srcfull,
- use_decimal=True,
- object_pairs_hook=validate.checking_dict)
- except ValueError:
- raise SystemExit(sys.exc_info()[1])
+ try:
+ srcfull = infile.read()
+ obj = hjson.loads(srcfull,
+ use_decimal=True,
+ object_pairs_hook=validate.checking_dict)
+ except ValueError:
+ raise SystemExit(sys.exc_info()[1])
if args.novalidate:
with outfile: