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
77bc04a3
Commit
77bc04a3
authored
Jun 28, 2016
by
Yury Selivanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
asyncio: Fix NameError in sslproto _fatal_error()
Patch by Richard Walker.
parent
2e4cdb67
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
+17
-0
Lib/asyncio/sslproto.py
Lib/asyncio/sslproto.py
+1
-0
Lib/test/test_asyncio/test_sslproto.py
Lib/test/test_asyncio/test_sslproto.py
+16
-0
No files found.
Lib/asyncio/sslproto.py
View file @
77bc04a3
...
...
@@ -5,6 +5,7 @@ try:
except
ImportError
:
# pragma: no cover
ssl
=
None
from
.
import
base_events
from
.
import
compat
from
.
import
protocols
from
.
import
transports
...
...
Lib/test/test_asyncio/test_sslproto.py
View file @
77bc04a3
"""Tests for asyncio/sslproto.py."""
import
logging
import
unittest
from
unittest
import
mock
try
:
...
...
@@ -8,6 +9,7 @@ except ImportError:
ssl
=
None
import
asyncio
from
asyncio
import
log
from
asyncio
import
sslproto
from
asyncio
import
test_utils
...
...
@@ -66,6 +68,20 @@ class SslProtoHandshakeTests(test_utils.TestCase):
test_utils
.
run_briefly
(
self
.
loop
)
self
.
assertIsInstance
(
waiter
.
exception
(),
ConnectionResetError
)
def
test_fatal_error_no_name_error
(
self
):
# From issue #363.
# _fatal_error() generates a NameError if sslproto.py
# does not import base_events.
waiter
=
asyncio
.
Future
(
loop
=
self
.
loop
)
ssl_proto
=
self
.
ssl_protocol
(
waiter
)
# Temporarily turn off error logging so as not to spoil test output.
log_level
=
log
.
logger
.
getEffectiveLevel
()
log
.
logger
.
setLevel
(
logging
.
FATAL
)
try
:
ssl_proto
.
_fatal_error
(
None
)
finally
:
# Restore error logging.
log
.
logger
.
setLevel
(
log_level
)
if
__name__
==
'__main__'
:
unittest
.
main
()
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