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
a8f4e15f
Commit
a8f4e15f
authored
Dec 26, 2017
by
Andrew Svetlov
Committed by
GitHub
Dec 26, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-26133: Fix typos (#5010)
* Fix typos * Change warning text * Add test
parent
e0aef4f3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
2 deletions
+19
-2
Lib/asyncio/unix_events.py
Lib/asyncio/unix_events.py
+2
-2
Lib/test/test_asyncio/test_unix_events.py
Lib/test/test_asyncio/test_unix_events.py
+17
-0
No files found.
Lib/asyncio/unix_events.py
View file @
a8f4e15f
...
@@ -56,9 +56,9 @@ class _UnixSelectorEventLoop(selector_events.BaseSelectorEventLoop):
...
@@ -56,9 +56,9 @@ class _UnixSelectorEventLoop(selector_events.BaseSelectorEventLoop):
self
.
remove_signal_handler
(
sig
)
self
.
remove_signal_handler
(
sig
)
else
:
else
:
if
self
.
_signal_handlers
:
if
self
.
_signal_handlers
:
war
ini
gs
.
warn
(
f"Closing the loop
{
self
!
r
}
"
war
nin
gs
.
warn
(
f"Closing the loop
{
self
!
r
}
"
f"on interpreter shutdown "
f"on interpreter shutdown "
f"stage, s
ignal unsubsription is disabled
"
,
f"stage, s
kipping signal handlers removal
"
,
ResourceWarning
,
ResourceWarning
,
source
=
self
)
source
=
self
)
self
.
_signal_handlers
.
clear
()
self
.
_signal_handlers
.
clear
()
...
...
Lib/test/test_asyncio/test_unix_events.py
View file @
a8f4e15f
...
@@ -229,6 +229,23 @@ class SelectorEventLoopSignalTests(test_utils.TestCase):
...
@@ -229,6 +229,23 @@ class SelectorEventLoopSignalTests(test_utils.TestCase):
self
.
assertEqual
(
len
(
self
.
loop
.
_signal_handlers
),
0
)
self
.
assertEqual
(
len
(
self
.
loop
.
_signal_handlers
),
0
)
m_signal
.
set_wakeup_fd
.
assert_called_once_with
(
-
1
)
m_signal
.
set_wakeup_fd
.
assert_called_once_with
(
-
1
)
@
mock
.
patch
(
'asyncio.unix_events.sys'
)
@
mock
.
patch
(
'asyncio.unix_events.signal'
)
def
test_close_on_finalizing
(
self
,
m_signal
,
m_sys
):
m_signal
.
NSIG
=
signal
.
NSIG
self
.
loop
.
add_signal_handler
(
signal
.
SIGHUP
,
lambda
:
True
)
self
.
assertEqual
(
len
(
self
.
loop
.
_signal_handlers
),
1
)
m_sys
.
is_finalizing
.
return_value
=
True
m_signal
.
signal
.
reset_mock
()
with
self
.
assertWarnsRegex
(
ResourceWarning
,
"skipping signal handlers removal"
):
self
.
loop
.
close
()
self
.
assertEqual
(
len
(
self
.
loop
.
_signal_handlers
),
0
)
self
.
assertFalse
(
m_signal
.
signal
.
called
)
@
unittest
.
skipUnless
(
hasattr
(
socket
,
'AF_UNIX'
),
@
unittest
.
skipUnless
(
hasattr
(
socket
,
'AF_UNIX'
),
'UNIX Sockets are not supported'
)
'UNIX Sockets are not supported'
)
...
...
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