summaryrefslogtreecommitdiffstats
path: root/scripts/lib/wic/msger.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/lib/wic/msger.py')
-rw-r--r--scripts/lib/wic/msger.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/scripts/lib/wic/msger.py b/scripts/lib/wic/msger.py
index 1b60980296..b737554228 100644
--- a/scripts/lib/wic/msger.py
+++ b/scripts/lib/wic/msger.py
@@ -151,10 +151,10 @@ def _split_msg(head, msg):
151 msg = msg.lstrip() 151 msg = msg.lstrip()
152 head = '\r' + head 152 head = '\r' + head
153 153
154 m = PREFIX_RE.match(msg) 154 match = PREFIX_RE.match(msg)
155 if m: 155 if match:
156 head += ' <%s>' % m.group(1) 156 head += ' <%s>' % match.group(1)
157 msg = m.group(2) 157 msg = match.group(2)
158 158
159 return head, msg 159 return head, msg
160 160
@@ -271,9 +271,8 @@ def set_logfile(fpath):
271 271
272 def _savelogf(): 272 def _savelogf():
273 if LOG_FILE_FP: 273 if LOG_FILE_FP:
274 fp = open(LOG_FILE_FP, 'w') 274 with open(LOG_FILE_FP, 'w') as log:
275 fp.write(LOG_CONTENT) 275 log.write(LOG_CONTENT)
276 fp.close()
277 276
278 if LOG_FILE_FP is not None: 277 if LOG_FILE_FP is not None:
279 warning('duplicate log file configuration') 278 warning('duplicate log file configuration')