8000 bpo-44011: Fix asyncio tests without ssl module (GH-25840) by tiran · Pull Request #25840 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-44011: Fix asyncio tests without ssl module (GH-25840) #25840

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
bpo-44011: Fix asyncio tests without ssl module
Signed-off-by: Christian Heimes <christian@python.org>
  • Loading branch information
tiran committed May 3, 2021
commit 72a18c22cca1fcb0284940bc411ec71e6931cc66
3 changes: 2 additions & 1 deletion Lib/asyncio/sslproto.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
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):
Expand Down
9 changes: 7 additions & 2 deletions Lib/test/test_asyncio/test_ssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@
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
Expand Down Expand Up @@ -54,6 +58,7 @@ def connection_lost(self, exc):
self.done.set_result(None)


@unittest.skipIf(ssl is None, 'No ssl module')
class TestSSL(test_utils.TestCase):

PAYLOAD_SIZE = 1024 * 100
Expand Down
0