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
79fd9626
Commit
79fd9626
authored
Mar 27, 2015
by
Victor Stinner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
asyncio: Fix _SelectorTransport.__repr__() if the event loop is closed
parent
0b4e355b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
Lib/asyncio/selector_events.py
Lib/asyncio/selector_events.py
+1
-1
Lib/test/test_asyncio/test_selector_events.py
Lib/test/test_asyncio/test_selector_events.py
+5
-0
No files found.
Lib/asyncio/selector_events.py
View file @
79fd9626
...
@@ -535,7 +535,7 @@ class _SelectorTransport(transports._FlowControlMixin,
...
@@ -535,7 +535,7 @@ class _SelectorTransport(transports._FlowControlMixin,
info
.
append
(
'closing'
)
info
.
append
(
'closing'
)
info
.
append
(
'fd=%s'
%
self
.
_sock_fd
)
info
.
append
(
'fd=%s'
%
self
.
_sock_fd
)
# test if the transport was closed
# test if the transport was closed
if
self
.
_loop
is
not
None
:
if
self
.
_loop
is
not
None
and
not
self
.
_loop
.
is_closed
()
:
polling
=
_test_selector_event
(
self
.
_loop
.
_selector
,
polling
=
_test_selector_event
(
self
.
_loop
.
_selector
,
self
.
_sock_fd
,
selectors
.
EVENT_READ
)
self
.
_sock_fd
,
selectors
.
EVENT_READ
)
if
polling
:
if
polling
:
...
...
Lib/test/test_asyncio/test_selector_events.py
View file @
79fd9626
...
@@ -62,6 +62,11 @@ class BaseSelectorEventLoopTests(test_utils.TestCase):
...
@@ -62,6 +62,11 @@ class BaseSelectorEventLoopTests(test_utils.TestCase):
self
.
loop
.
add_reader
.
_is_coroutine
=
False
self
.
loop
.
add_reader
.
_is_coroutine
=
False
transport
=
self
.
loop
.
_make_socket_transport
(
m
,
asyncio
.
Protocol
())
transport
=
self
.
loop
.
_make_socket_transport
(
m
,
asyncio
.
Protocol
())
self
.
assertIsInstance
(
transport
,
_SelectorSocketTransport
)
self
.
assertIsInstance
(
transport
,
_SelectorSocketTransport
)
# Calling repr() must not fail when the event loop is closed
self
.
loop
.
close
()
repr
(
transport
)
close_transport
(
transport
)
close_transport
(
transport
)
@
unittest
.
skipIf
(
ssl
is
None
,
'No ssl module'
)
@
unittest
.
skipIf
(
ssl
is
None
,
'No ssl module'
)
...
...
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