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
9fcf71f9
Commit
9fcf71f9
authored
Dec 28, 2010
by
Brian Quinlan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Does not install a logging handler. Fixes issue 10626.
parent
aedbb297
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
12 deletions
+3
-12
Lib/concurrent/futures/_base.py
Lib/concurrent/futures/_base.py
+0
-2
Lib/test/test_concurrent_futures.py
Lib/test/test_concurrent_futures.py
+3
-10
No files found.
Lib/concurrent/futures/_base.py
View file @
9fcf71f9
...
...
@@ -41,8 +41,6 @@ _STATE_TO_DESCRIPTION_MAP = {
# Logger for internal use by the futures package.
LOGGER
=
logging
.
getLogger
(
"concurrent.futures"
)
STDERR_HANDLER
=
logging
.
StreamHandler
()
LOGGER
.
addHandler
(
STDERR_HANDLER
)
class
Error
(
Exception
):
"""Base class for all future-related exceptions."""
...
...
Lib/test/test_concurrent_futures.py
View file @
9fcf71f9
...
...
@@ -24,7 +24,7 @@ if sys.platform.startswith('win'):
from
concurrent
import
futures
from
concurrent.futures._base
import
(
PENDING
,
RUNNING
,
CANCELLED
,
CANCELLED_AND_NOTIFIED
,
FINISHED
,
Future
,
LOGGER
,
STDERR_HANDLER
,
wait
)
LOGGER
,
wait
)
import
concurrent.futures.process
def
create_future
(
state
=
PENDING
,
exception
=
None
,
result
=
None
):
...
...
@@ -632,11 +632,7 @@ class FutureTests(unittest.TestCase):
self
.
assertTrue
(
was_cancelled
)
def
test_done_callback_raises
(
self
):
LOGGER
.
removeHandler
(
STDERR_HANDLER
)
logging_stream
=
io
.
StringIO
()
handler
=
logging
.
StreamHandler
(
logging_stream
)
LOGGER
.
addHandler
(
handler
)
try
:
with
test
.
support
.
captured_stderr
()
as
stderr
:
raising_was_called
=
False
fn_was_called
=
False
...
...
@@ -655,10 +651,7 @@ class FutureTests(unittest.TestCase):
f
.
set_result
(
5
)
self
.
assertTrue
(
raising_was_called
)
self
.
assertTrue
(
fn_was_called
)
self
.
assertIn
(
'Exception: doh!'
,
logging_stream
.
getvalue
())
finally
:
LOGGER
.
removeHandler
(
handler
)
LOGGER
.
addHandler
(
STDERR_HANDLER
)
self
.
assertIn
(
'Exception: doh!'
,
stderr
.
getvalue
())
def
test_done_callback_already_successful
(
self
):
callback_result
=
None
...
...
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