Patchwork run-tests: open hgrc file only for writing

login
register
mail settings
Submitter Simon Heimberg
Date June 5, 2013, 9:21 p.m.
Message ID <1c21d1865eaff1652c9a.1370467268@lapsi.heimberg.home>
Download mbox | patch
Permalink /patch/1707/
State Accepted
Commit cdc612db2ffba845d00885c9759f0c2d81f46397
Headers show

Comments

Simon Heimberg - June 5, 2013, 9:21 p.m.
# HG changeset patch
# User Simon Heimberg <simohe@besonet.ch>
# Date 1370464963 -7200
# Node ID 1c21d1865eaff1652c9a454d34a73b86fd8302f9
# Parent  f72121d11dc38ec4e0fe006cb34cd92b98155027
run-tests: open hgrc file only for writing

The file is not read here. Opening with "w+" is unnecessary.

Patch

diff -r f72121d11dc3 -r 1c21d1865eaf tests/run-tests.py
--- a/tests/run-tests.py	Mit Jun 05 22:41:53 2013 +0200
+++ b/tests/run-tests.py	Mit Jun 05 22:42:43 2013 +0200
@@ -333,7 +333,7 @@ 
 
 def createhgrc(path, options):
     # create a fresh hgrc
-    hgrc = open(path, 'w+')
+    hgrc = open(path, 'w')
     hgrc.write('[ui]\n')
     hgrc.write('slash = True\n')
     hgrc.write('interactive = False\n')