[Python-checkins] cpython: Reverted change to venv initialisation.

vinay.sajip python-checkins at python.org
Fri Aug 24 21:01:14 CEST 2012


http://hg.python.org/cpython/rev/c8ff866591f7
changeset:   78753:c8ff866591f7
user:        Vinay Sajip <vinay_sajip at yahoo.co.uk>
date:        Fri Aug 24 20:01:02 2012 +0100
summary:
  Reverted change to venv initialisation.

files:
  Lib/venv/__init__.py |  10 +---------
  1 files changed, 1 insertions(+), 9 deletions(-)


diff --git a/Lib/venv/__init__.py b/Lib/venv/__init__.py
--- a/Lib/venv/__init__.py
+++ b/Lib/venv/__init__.py
@@ -105,15 +105,7 @@
         if os.path.exists(env_dir) and not (self.clear or self.upgrade):
             raise ValueError('Directory exists: %s' % env_dir)
         if os.path.exists(env_dir) and self.clear:
-            # Issue 15776: To support running pyvenv on '.', the venv
-            # directory contents are emptied and recreated, instead of
-            # the venv directory being deleted and recreated.
-            for f in os.listdir(env_dir):
-                f = os.path.join(env_dir, f)
-                if os.path.isdir(f):
-                    shutil.rmtree(f)
-                else:
-                    os.remove(f)
+            shutil.rmtree(env_dir)
         context = Context()
         context.env_dir = env_dir
         context.env_name = os.path.split(env_dir)[1]

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list