Browse Source

small style cleanup

INADA Naoki 12 years ago
parent
commit
9e3a6c3354
1 changed files with 3 additions and 4 deletions
  1. 3 4
      setup_util.py

+ 3 - 4
setup_util.py

@@ -4,7 +4,6 @@ import re
 def replace_text(file, to_replace, replacement):
 def replace_text(file, to_replace, replacement):
   with open(file, "r") as conf:
   with open(file, "r") as conf:
     contents = conf.read()
     contents = conf.read()
-    replaced_text = re.sub(to_replace, replacement, contents)
-  f = open(file, "w")
-  f.write(replaced_text)
-  f.close()
+  replaced_text = re.sub(to_replace, replacement, contents)
+  with open(file, "w") as f:
+    f.write(replaced_text)