Avoid Python 2 compat (conditional) imports. (#1167)

This commit is contained in:
Felix Fontein
2025-10-13 22:31:59 +02:00
committed by GitHub
parent 6f9ebc3f14
commit 597162b153
6 changed files with 8 additions and 32 deletions
@@ -9,6 +9,7 @@
from __future__ import annotations
import unittest
from ssl import OP_NO_SSLv2, OP_NO_SSLv3, OP_NO_TLSv1
import pytest
@@ -24,13 +25,6 @@ except ImportError:
else:
HAS_MATCH_HOSTNAME = True # pylint: disable=invalid-name
try:
from ssl import OP_NO_SSLv2, OP_NO_SSLv3, OP_NO_TLSv1
except ImportError:
OP_NO_SSLv2 = 0x1000000
OP_NO_SSLv3 = 0x2000000
OP_NO_TLSv1 = 0x4000000
class SSLAdapterTest(unittest.TestCase):
def test_only_uses_tls(self):