From: Vinay Sajip Date: Thu, 5 Jun 2014 08:31:20 +0000 (+0100) Subject: Issue #21663: Fixed error caused by trying to create an existing directory. X-Git-Tag: v3.4.2rc1~439 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1a170a74f7c2fc57e9df7bce139a604ddface1fc;p=python Issue #21663: Fixed error caused by trying to create an existing directory. --- diff --git a/Lib/venv/__init__.py b/Lib/venv/__init__.py index b5ef2d88e9..3a7e8e257a 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)