Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/websocket/_ssl_compat.py: 44%
16 statements
« prev ^ index » next coverage.py v7.3.1, created at 2023-09-25 06:34 +0000
« prev ^ index » next coverage.py v7.3.1, created at 2023-09-25 06:34 +0000
1"""
2_ssl_compat.py
3websocket - WebSocket client library for Python
5Copyright 2023 engn33r
7Licensed under the Apache License, Version 2.0 (the "License");
8you may not use this file except in compliance with the License.
9You may obtain a copy of the License at
11 http://www.apache.org/licenses/LICENSE-2.0
13Unless required by applicable law or agreed to in writing, software
14distributed under the License is distributed on an "AS IS" BASIS,
15WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16See the License for the specific language governing permissions and
17limitations under the License.
18"""
19__all__ = ["HAVE_SSL", "ssl", "SSLError", "SSLWantReadError", "SSLWantWriteError"]
21try:
22 import ssl
23 from ssl import SSLError
24 from ssl import SSLWantReadError
25 from ssl import SSLWantWriteError
26 HAVE_SSL = True
27except ImportError:
28 # dummy class of SSLError for environment without ssl support
29 class SSLError(Exception):
30 pass
32 class SSLWantReadError(Exception):
33 pass
35 class SSLWantWriteError(Exception):
36 pass
38 ssl = None
39 HAVE_SSL = False