Skip to content

Commit 9e6955b

Browse files
committed
Address copilot review comments
1 parent 5c43405 commit 9e6955b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

config/add-overlay-annotations.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#!/usr/bin/python3
1818
import sys
1919
import os
20-
from difflib import *
20+
from difflib import context_diff
2121

2222

2323
def has_overlay_annotations(lines):
@@ -209,7 +209,8 @@ def process_single_file(write, filename):
209209
If write is set, the changes are written back to the file.
210210
Returns True if the file requires changes.
211211
'''
212-
old = [line for line in open(filename)]
212+
with open(filename) as f:
213+
old = [line for line in f]
213214

214215
annotate_result = annotate_as_appropriate(filename, old)
215216
if annotate_result is None:
@@ -270,4 +271,4 @@ def process_single_file(write, filename):
270271
print("and " + str(len(missingAnnotations) - 10) + " additional files.")
271272
print()
272273
print("Please manually add overlay annotations or use the config/add-overlay-annotations.py script to automatically add sensible default overlay annotations.")
273-
exit(-1)
274+
exit(1)

0 commit comments

Comments
 (0)