mirror of https://github.com/python/cpython
bpo-44011: Fix asyncio tests without ssl module (GH-25840)
Signed-off-by: Christian Heimes <christian@python.org>
This commit is contained in:
parent
99ad742ea9
commit
37ebdf0a86
|
@ -12,7 +12,8 @@ from . import protocols
|
|||
from . import transports
|
||||
from .log import logger
|
||||
|
||||
SSLAgainErrors = (ssl.SSLWantReadError, ssl.SSLSyscallError)
|
||||
if ssl is not None:
|
||||
SSLAgainErrors = (ssl.SSLWantReadError, ssl.SSLSyscallError)
|
||||
|
||||
|
||||
class SSLProtocolState(enum.Enum):
|
||||
|
|
|
@ -3,14 +3,18 @@ import asyncio.sslproto
|
|||
import contextlib
|
||||
import gc
|
||||
import logging
|
||||
import os
|
||||
import select
|
||||
import socket
|
||||
import ssl
|
||||
import tempfile
|
||||
import threading
|
||||
import time
|
||||
import weakref
|
||||
import unittest
|
||||
|
||||
try:
|
||||
import ssl
|
||||
except ImportError:
|
||||
ssl = None
|
||||
|
||||
from test import support
|
||||
from test.test_asyncio import utils as test_utils
|
||||
|
@ -54,6 +58,7 @@ class MyBaseProto(asyncio.Protocol):
|
|||
self.done.set_result(None)
|
||||
|
||||
|
||||
@unittest.skipIf(ssl is None, 'No ssl module')
|
||||
class TestSSL(test_utils.TestCase):
|
||||
|
||||
PAYLOAD_SIZE = 1024 * 100
|
||||
|
|
Loading…
Reference in New Issue