Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.buildout
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
slapos.buildout
Commits
e3f11c25
Commit
e3f11c25
authored
May 21, 2020
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix redo_pyc for Python 3
parent
16ed0283
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
6 deletions
+17
-6
src/zc/buildout/easy_install.py
src/zc/buildout/easy_install.py
+17
-6
No files found.
src/zc/buildout/easy_install.py
View file @
e3f11c25
...
@@ -1692,20 +1692,31 @@ def redo_pyc(egg):
...
@@ -1692,20 +1692,31 @@ def redo_pyc(egg):
chmod
(
dirpath
)
chmod
(
dirpath
)
for
filename
in
filenames
:
for
filename
in
filenames
:
filepath
=
os
.
path
.
join
(
dirpath
,
filename
)
filepath
=
os
.
path
.
join
(
dirpath
,
filename
)
chmod
(
filepath
)
try
:
chmod
(
filepath
)
except
OSError
as
e
:
if
e
.
errno
!=
errno
.
ENOENT
:
raise
continue
if
not
filename
.
endswith
(
'.py'
):
if
not
filename
.
endswith
(
'.py'
):
continue
continue
if
not
(
os
.
path
.
exists
(
filepath
+
'c'
)
or
os
.
path
.
exists
(
filepath
+
'o'
)):
old
=
[]
pycache
=
os
.
path
.
join
(
dirpath
,
'__pycache__'
,
filename
[:
-
3
]
+
'.*.py'
)
for
suffix
in
'co'
:
if
os
.
path
.
exists
(
filepath
+
suffix
):
old
.
append
(
filepath
+
suffix
)
old
+=
glob
.
glob
(
pycache
+
suffix
)
if
not
old
:
# If it wasn't compiled, it may not be compilable
# If it wasn't compiled, it may not be compilable
continue
continue
# OK, it looks like we should try to compile.
# OK, it looks like we should try to compile.
# Remove old files.
# Remove old files.
for
suffix
in
'co'
:
for
old
in
old
:
if
os
.
path
.
exists
(
filepath
+
suffix
):
os
.
remove
(
old
)
os
.
remove
(
filepath
+
suffix
)
# Compile under current optimization
# Compile under current optimization
try
:
try
:
...
...
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