]> granicus.if.org Git - python/commitdiff
Reverted change to venv initialisation.
authorVinay Sajip <vinay_sajip@yahoo.co.uk>
Fri, 24 Aug 2012 19:01:02 +0000 (20:01 +0100)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>
Fri, 24 Aug 2012 19:01:02 +0000 (20:01 +0100)
Lib/venv/__init__.py

index 3553fecb896eaefdb81fbe52e3c503394009234a..8d2deb738560edfc77fe50b8b99b462e62687bbb 100644 (file)
@@ -105,15 +105,7 @@ class EnvBuilder:
         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]