Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
33ab35dc
Commit
33ab35dc
authored
Aug 24, 2012
by
Andrew Svetlov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #15776: Allow pyvenv to work in existing directory with --clean.
Patch by Vinay Sajip.
parent
cbff7d05
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
Lib/venv/__init__.py
Lib/venv/__init__.py
+9
-1
Misc/NEWS
Misc/NEWS
+2
-0
No files found.
Lib/venv/__init__.py
View file @
33ab35dc
...
...
@@ -105,7 +105,15 @@ 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
:
shutil
.
rmtree
(
env_dir
)
# 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
)
context
=
Context
()
context
.
env_dir
=
env_dir
context
.
env_name
=
os
.
path
.
split
(
env_dir
)[
1
]
...
...
Misc/NEWS
View file @
33ab35dc
...
...
@@ -29,6 +29,8 @@ Core and Builtins
Library
-------
- Issue #15776: Allow pyvenv to work in existing directory with --clean.
- Issue #15249: BytesGenerator now correctly mangles From lines (when
requested) even if the body contains undecodable bytes.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment