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
b494efb6
Commit
b494efb6
authored
Jun 03, 2014
by
Vinay Sajip
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #21643: Updated test and fixed logic bug in lib64 symlink creation.
parent
1f99180a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
14 deletions
+19
-14
Lib/test/test_venv.py
Lib/test/test_venv.py
+16
-11
Lib/venv/__init__.py
Lib/venv/__init__.py
+3
-3
No files found.
Lib/test/test_venv.py
View file @
b494efb6
...
...
@@ -203,17 +203,22 @@ class BasicTest(BaseTest):
"""
Test upgrading an existing environment directory.
"""
builder
=
venv
.
EnvBuilder
(
upgrade
=
True
)
self
.
run_with_capture
(
builder
.
create
,
self
.
env_dir
)
self
.
isdir
(
self
.
bindir
)
self
.
isdir
(
self
.
include
)
self
.
isdir
(
*
self
.
lib
)
fn
=
self
.
get_env_file
(
self
.
bindir
,
self
.
exe
)
if
not
os
.
path
.
exists
(
fn
):
# diagnostics for Windows buildbot failures
bd
=
self
.
get_env_file
(
self
.
bindir
)
print
(
'Contents of %r:'
%
bd
)
print
(
' %r'
%
os
.
listdir
(
bd
))
self
.
assertTrue
(
os
.
path
.
exists
(
fn
),
'File %r should exist.'
%
fn
)
# See Issue #21643: the loop needs to run twice to ensure
# that everything works on the upgrade (the first run just creates
# the venv).
for
upgrade
in
(
False
,
True
):
builder
=
venv
.
EnvBuilder
(
upgrade
=
upgrade
)
self
.
run_with_capture
(
builder
.
create
,
self
.
env_dir
)
self
.
isdir
(
self
.
bindir
)
self
.
isdir
(
self
.
include
)
self
.
isdir
(
*
self
.
lib
)
fn
=
self
.
get_env_file
(
self
.
bindir
,
self
.
exe
)
if
not
os
.
path
.
exists
(
fn
):
# diagnostics for Windows buildbot failures
bd
=
self
.
get_env_file
(
self
.
bindir
)
print
(
'Contents of %r:'
%
bd
)
print
(
' %r'
%
os
.
listdir
(
bd
))
self
.
assertTrue
(
os
.
path
.
exists
(
fn
),
'File %r should exist.'
%
fn
)
def
test_isolation
(
self
):
"""
...
...
Lib/venv/__init__.py
View file @
b494efb6
...
...
@@ -30,7 +30,6 @@ optional arguments:
import
logging
import
os
import
shutil
import
struct
import
subprocess
import
sys
import
types
...
...
@@ -140,11 +139,12 @@ class EnvBuilder:
create_if_needed
(
path
)
create_if_needed
(
libpath
)
# Issue 21197: create lib64 as a symlink to lib on 64-bit non-OS X POSIX
if
((
s
truct
.
calcsize
(
'P'
)
==
8
)
and
(
os
.
name
==
'posix'
)
and
if
((
s
ys
.
maxsize
>
2
**
32
)
and
(
os
.
name
==
'posix'
)
and
(
sys
.
platform
!=
'darwin'
)):
p
=
os
.
path
.
join
(
env_dir
,
'lib'
)
link_path
=
os
.
path
.
join
(
env_dir
,
'lib64'
)
os
.
symlink
(
p
,
link_path
)
if
not
os
.
path
.
exists
(
link_path
):
# Issue #21643
os
.
symlink
(
p
,
link_path
)
context
.
bin_path
=
binpath
=
os
.
path
.
join
(
env_dir
,
binname
)
context
.
bin_name
=
binname
context
.
env_exe
=
os
.
path
.
join
(
binpath
,
exename
)
...
...
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