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
949c416d
Commit
949c416d
authored
Apr 22, 2015
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Plain Diff
Merge heads
parents
71b49dde
d86ef05a
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
9 deletions
+10
-9
Doc/library/compileall.rst
Doc/library/compileall.rst
+2
-2
Lib/compileall.py
Lib/compileall.py
+1
-3
Lib/test/test_compileall.py
Lib/test/test_compileall.py
+4
-4
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Doc/library/compileall.rst
View file @
949c416d
...
...
@@ -142,8 +142,8 @@ Public functions
The argument *workers* specifies how many workers are used to
compile files in parallel. The default is to not use multiple workers.
If the platform can't use multiple workers and *workers* argument is given,
then
a :exc:`NotImplementedError` will be raised.
If *workers* is
lower than ``0``, a :exc:`ValueError` will be raised.
then
sequential compilation will be used as a fallback. If *workers* is
lower than ``0``, a :exc:`ValueError` will be raised.
.. versionchanged:: 3.2
Added the *legacy* and *optimize* parameter.
...
...
Lib/compileall.py
View file @
949c416d
...
...
@@ -69,11 +69,9 @@ def compile_dir(dir, maxlevels=10, ddir=None, force=False, rx=None,
files
=
_walk_dir
(
dir
,
quiet
=
quiet
,
maxlevels
=
maxlevels
,
ddir
=
ddir
)
success
=
1
if
workers
is
not
None
and
workers
!=
1
:
if
workers
is
not
None
and
workers
!=
1
and
ProcessPoolExecutor
is
not
None
:
if
workers
<
0
:
raise
ValueError
(
'workers must be greater or equal to 0'
)
if
ProcessPoolExecutor
is
None
:
raise
NotImplementedError
(
'multiprocessing support not available'
)
workers
=
workers
or
None
with
ProcessPoolExecutor
(
max_workers
=
workers
)
as
executor
:
...
...
Lib/test/test_compileall.py
View file @
949c416d
...
...
@@ -136,10 +136,10 @@ class CompileallTests(unittest.TestCase):
self
.
assertTrue
(
compile_file_mock
.
called
)
@
mock
.
patch
(
'compileall.ProcessPoolExecutor'
,
new
=
None
)
def
test_compile_missing_multiprocessing
(
self
):
with
self
.
assertRaisesRegex
(
NotImplementedError
,
"multiprocessing support not available"
):
@
mock
.
patch
(
'compileall.compile_file'
)
def
test_compile_missing_multiprocessing
(
self
,
compile_file_mock
):
compileall
.
compile_dir
(
self
.
directory
,
quiet
=
True
,
workers
=
5
)
self
.
assertTrue
(
compile_file_mock
.
called
)
class
EncodingTest
(
unittest
.
TestCase
):
"""Issue 6716: compileall should escape source code when printing errors
...
...
Misc/NEWS
View file @
949c416d
...
...
@@ -15,6 +15,9 @@ Core and Builtins
Library
-------
- Issue #23917: Fall back to sequential compilation when ProcessPoolExecutor
doesn'
t
exist
.
Patch
by
Claudiu
Popa
.
-
Issue
#
23008
:
Fixed
resolving
attributes
with
boolean
value
is
False
in
pydoc
.
-
Fix
asyncio
issue
235
:
LifoQueue
and
PriorityQueue
's put didn'
t
...
...
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