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
7ed7ce6e
Commit
7ed7ce6e
authored
May 16, 2016
by
Yury Selivanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #27040: Add loop.get_exception_handler method
parent
7bf36dac
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
0 deletions
+12
-0
Lib/asyncio/base_events.py
Lib/asyncio/base_events.py
+5
-0
Lib/asyncio/events.py
Lib/asyncio/events.py
+3
-0
Lib/test/test_asyncio/test_base_events.py
Lib/test/test_asyncio/test_base_events.py
+2
-0
Misc/NEWS
Misc/NEWS
+2
-0
No files found.
Lib/asyncio/base_events.py
View file @
7ed7ce6e
...
...
@@ -1078,6 +1078,11 @@ class BaseEventLoop(events.AbstractEventLoop):
logger
.
info
(
'%s: %r'
%
(
debug_log
,
transport
))
return
transport
,
protocol
def
get_exception_handler
(
self
):
"""Return an exception handler, or None if the default one is in use.
"""
return
self
.
_exception_handler
def
set_exception_handler
(
self
,
handler
):
"""Set handler as the new event loop exception handler.
...
...
Lib/asyncio/events.py
View file @
7ed7ce6e
...
...
@@ -484,6 +484,9 @@ class AbstractEventLoop:
# Error handlers.
def
get_exception_handler
(
self
):
raise
NotImplementedError
def
set_exception_handler
(
self
,
handler
):
raise
NotImplementedError
...
...
Lib/test/test_asyncio/test_base_events.py
View file @
7ed7ce6e
...
...
@@ -658,8 +658,10 @@ class BaseEventLoopTests(test_utils.TestCase):
self
.
loop
.
set_debug
(
True
)
self
.
loop
.
_process_events
=
mock
.
Mock
()
self
.
assertIsNone
(
self
.
loop
.
get_exception_handler
())
mock_handler
=
mock
.
Mock
()
self
.
loop
.
set_exception_handler
(
mock_handler
)
self
.
assertIs
(
self
.
loop
.
get_exception_handler
(),
mock_handler
)
handle
=
run_loop
()
mock_handler
.
assert_called_with
(
self
.
loop
,
{
'exception'
:
MOCK_ANY
,
...
...
Misc/NEWS
View file @
7ed7ce6e
...
...
@@ -454,6 +454,8 @@ Library
-
Issue
#
26848
:
Fix
asyncio
/
subprocess
.
communicate
()
to
handle
empty
input
.
Patch
by
Jack
O
'Connor.
- Issue #27040: Add loop.get_exception_handler method
Documentation
-------------
...
...
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