[Checkins] SVN: zc.zope3recipes/branches/0.6/zc/zope3recipes/tests.py fix for windows, and shortened

Christophe Combelles ccomb at free.fr
Thu Aug 14 06:17:15 EDT 2008


Log message for revision 89825:
  fix for windows, and shortened
  

Changed:
  U   zc.zope3recipes/branches/0.6/zc/zope3recipes/tests.py

-=-
Modified: zc.zope3recipes/branches/0.6/zc/zope3recipes/tests.py
===================================================================
--- zc.zope3recipes/branches/0.6/zc/zope3recipes/tests.py	2008-08-14 09:51:37 UTC (rev 89824)
+++ zc.zope3recipes/branches/0.6/zc/zope3recipes/tests.py	2008-08-14 10:17:14 UTC (rev 89825)
@@ -124,18 +124,13 @@
     zc.buildout.testing.install('ZConfig', test)
     zc.buildout.testing.install('zc.recipe.filestorage', test)
     # prevent upgrade during test
-    if not os.path.exists(os.environ['HOME']):
-        os.mkdir(os.environ['HOME'])
-    buildout_defaults_dir = os.path.join(os.environ['HOME'],
-                                        '.buildout')
-    buildout_defaults_file = os.path.join(buildout_defaults_dir,
-                                          'default.cfg')
-    if not os.path.exists(buildout_defaults_dir):
-        os.mkdir(buildout_defaults_dir)
-    if not os.path.exists(buildout_defaults_file):
-        open(buildout_defaults_file, 'w').write(
-        "[buildout]\n"
-        "newest = false")
+    conf_dir = os.path.join(os.path.expanduser('~'), '.buildout')
+    conf_file = os.path.join(conf_dir, 'default.cfg')
+    if not os.path.exists(conf_dir):
+        os.makedirs(conf_dir)
+    if not os.path.exists(conf_file):
+        open(conf_file, 'w').write("[buildout]\n"
+                                   "newest = false")
     else:
         raise RuntimeWarning('Unable to set "newest=false" for tests')
 



More information about the Checkins mailing list