summaryrefslogtreecommitdiffstats
path: root/Lib/venv
diff options
context:
space:
mode:
authorVinay Sajip <vinay_sajip@yahoo.co.uk>2014-06-05 08:31:20 (GMT)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>2014-06-05 08:31:20 (GMT)
commit1a170a74f7c2fc57e9df7bce139a604ddface1fc (patch)
tree6aba2b947507a03b0b64aa63e21037052c7cf749 /Lib/venv
parent7be121f2bcc27efc0ed1ef1a844e0cfb5defbcd3 (diff)
downloadcpython-1a170a74f7c2fc57e9df7bce139a604ddface1fc.zip
cpython-1a170a74f7c2fc57e9df7bce139a604ddface1fc.tar.gz
cpython-1a170a74f7c2fc57e9df7bce139a604ddface1fc.tar.bz2
Issue #21663: Fixed error caused by trying to create an existing directory.
Diffstat (limited to 'Lib/venv')
-rw-r--r--Lib/venv/__init__.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/venv/__init__.py b/Lib/venv/__init__.py
index b5ef2d8..3a7e8e2 100644
--- a/Lib/venv/__init__.py
+++ b/Lib/venv/__init__.py
@@ -238,7 +238,8 @@ class EnvBuilder:
if 'init.tcl' in files:
tcldir = os.path.basename(root)
tcldir = os.path.join(context.env_dir, 'Lib', tcldir)
- os.makedirs(tcldir)
+ if not os.path.exists(tcldir):
+ os.makedirs(tcldir)
src = os.path.join(root, 'init.tcl')
dst = os.path.join(tcldir, 'init.tcl')
shutil.copyfile(src, dst)