summaryrefslogtreecommitdiff
path: root/regtest
diff options
context:
space:
mode:
authorElliott Sales de Andrade <quantum.analyst@gmail.com>2018-10-22 00:26:40 -0400
committerAlbert Astals Cid <tsdgeos@yahoo.es>2018-11-18 09:53:40 +0000
commit7bb75cc533339a8480c16fe432ae4034b7ff5c57 (patch)
treee66076f93befab619a42eec771c75e2e9bd67789 /regtest
parentd02d1a1e62a13ff357815f13379a00f34b957233 (diff)
regtest: Fix file opened in wrong mode.
Diffstat (limited to 'regtest')
-rw-r--r--regtest/HTMLReport.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/regtest/HTMLReport.py b/regtest/HTMLReport.py
index c1867119..eb35ef9b 100644
--- a/regtest/HTMLReport.py
+++ b/regtest/HTMLReport.py
@@ -331,9 +331,8 @@ class HTMLReport:
html += failed + crashed + failed_to_run + "</body></html>"
report_index = os.path.join(self._htmldir, 'index.html')
- f = open(report_index, 'wb')
- f.write(html)
- f.close()
+ with open(report_index, 'w') as f:
+ f.write(html)
if launch_browser:
subprocess.Popen(['xdg-open', report_index])