SVN: zdaemon/branches/py3/src/zdaemon/tests/testzdrun.py Explicitly close files.

Marius Gedminas <[email protected]> Thu, 14 Feb 2013 06:15:43 -0500 (EST)
Newsgroups gmane.comp.web.zope.cvs
Message-ID <20130214111543.2430E940E7__12618.087771307$1360840570$gmane$org@cvs.zope.org>
Log message for revision 129394:
  Explicitly close files.

Changed:
  U   zdaemon/branches/py3/src/zdaemon/tests/testzdrun.py

-=-
Modified: zdaemon/branches/py3/src/zdaemon/tests/testzdrun.py
===================================================================
--- zdaemon/branches/py3/src/zdaemon/tests/testzdrun.py	2013-02-14 11:15:39 UTC (rev 129393)
+++ zdaemon/branches/py3/src/zdaemon/tests/testzdrun.py	2013-02-14 11:15:42 UTC (rev 129394)
@@ -384,7 +384,8 @@
 
     def writeConfig(self, config):
         config_file = os.path.join(self.root, 'config')
-        open(config_file, 'w').write(config)
+        with open(config_file, 'w') as f:
+            f.write(config)
         return config_file
 
     def testDirectoryChown(self):

_______________________________________________
Zope-Checkins maillist  -  [email protected]
https://mail.zope.org/mailman/listinfo/zope-checkins