summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVinay Sajip <vinay_sajip@yahoo.co.uk>2012-08-24 19:01:02 (GMT)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>2012-08-24 19:01:02 (GMT)
commita6894ba3c9a66f2a5af5cc663538f86c0fa10079 (patch)
treec3a10af2ce678d150f75aed00487ef23c3aeb02d
parent3bb6318ac6e3cfdd7ed50e59bbc913b3b19b80e5 (diff)
downloadcpython-a6894ba3c9a66f2a5af5cc663538f86c0fa10079.zip
cpython-a6894ba3c9a66f2a5af5cc663538f86c0fa10079.tar.gz
cpython-a6894ba3c9a66f2a5af5cc663538f86c0fa10079.tar.bz2
Reverted change to venv initialisation.
-rw-r--r--Lib/venv/__init__.py10
1 files changed, 1 insertions, 9 deletions
diff --git a/Lib/venv/__init__.py b/Lib/venv/__init__.py
index 3553fec..8d2deb7 100644
--- a/Lib/venv/__init__.py
+++ b/Lib/venv/__init__.py
@@ -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]