Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gwenaël Samain
cython
Commits
ff873413
Commit
ff873413
authored
Aug 10, 2013
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
provide serialised fallback if parallel processing fails
parent
30a8a314
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletion
+15
-1
bin/cythonize
bin/cythonize
+15
-1
No files found.
bin/cythonize
View file @
ff873413
...
@@ -18,6 +18,17 @@ except ImportError:
...
@@ -18,6 +18,17 @@ except ImportError:
parallel_compiles
=
0
parallel_compiles
=
0
class
_FakePool
(
object
):
def
map_async
(
self
,
func
,
args
):
from
itertools
import
imap
for
_
in
imap
(
func
,
args
):
pass
def
close
(
self
):
pass
def
terminate
(
self
):
pass
def
join
(
self
):
pass
def
parse_directives
(
option
,
name
,
value
,
parser
):
def
parse_directives
(
option
,
name
,
value
,
parser
):
dest
=
option
.
dest
dest
=
option
.
dest
old_directives
=
dict
(
getattr
(
parser
.
values
,
dest
,
old_directives
=
dict
(
getattr
(
parser
.
values
,
dest
,
...
@@ -87,7 +98,10 @@ def cython_compile(path_pattern, options):
...
@@ -87,7 +98,10 @@ def cython_compile(path_pattern, options):
if
options
.
build
:
if
options
.
build
:
if
len
(
ext_modules
)
>
1
and
options
.
parallel
:
if
len
(
ext_modules
)
>
1
and
options
.
parallel
:
if
pool
is
None
:
if
pool
is
None
:
pool
=
multiprocessing
.
Pool
(
options
.
parallel
)
try
:
pool
=
multiprocessing
.
Pool
(
options
.
parallel
)
except
OSError
:
pool
=
_FakePool
()
pool
.
map_async
(
run_distutils
,
[
pool
.
map_async
(
run_distutils
,
[
(
base_dir
,
[
ext
])
for
ext
in
ext_modules
])
(
base_dir
,
[
ext
])
for
ext
in
ext_modules
])
else
:
else
:
...
...
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