[Checkins] SVN: zc.zope3recipes/trunk/zc/zope3recipes/tests.py Merge from 0.6 branch:

Christophe Combelles ccomb at free.fr
Thu Aug 14 06:18:26 EDT 2008


Log message for revision 89826:
  Merge from 0.6 branch:
  fix for windows
  

Changed:
  U   zc.zope3recipes/trunk/zc/zope3recipes/tests.py

-=-
Modified: zc.zope3recipes/trunk/zc/zope3recipes/tests.py
===================================================================
--- zc.zope3recipes/trunk/zc/zope3recipes/tests.py	2008-08-14 10:17:14 UTC (rev 89825)
+++ zc.zope3recipes/trunk/zc/zope3recipes/tests.py	2008-08-14 10:18:26 UTC (rev 89826)
@@ -196,18 +196,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