Commit 2206505d authored by Jason Madden's avatar Jason Madden

Explicitly close one more file for Windows.

parent 1b79c488
...@@ -547,7 +547,8 @@ def preprocess_filename(filename, config): ...@@ -547,7 +547,8 @@ def preprocess_filename(filename, config):
definitions = {} definitions = {}
result = [] result = []
including_section = [] including_section = []
for line in open(filename): with open(filename) as f:
for line in f:
linecount += 1 linecount += 1
rstripped = line.rstrip() rstripped = line.rstrip()
stripped = rstripped.lstrip() stripped = rstripped.lstrip()
...@@ -897,7 +898,11 @@ def atomic_write(filename, data): ...@@ -897,7 +898,11 @@ def atomic_write(filename, data):
if os.path.exists(filename): if os.path.exists(filename):
os.unlink(filename) os.unlink(filename)
try:
os.rename(tmpname, filename) os.rename(tmpname, filename)
except:
log("Failed to rename '%s' to '%s", tmpname, filename)
raise
dbg('Wrote %s bytes to %s', len(data), filename) dbg('Wrote %s bytes to %s', len(data), filename)
......
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