Changed code to support older Python versions
This commit is contained in:
parent
eb92d2d36f
commit
582458cdd0
5027 changed files with 794942 additions and 4 deletions
19
venv/lib/python3.11/site-packages/dns/_tls_util.py
Normal file
19
venv/lib/python3.11/site-packages/dns/_tls_util.py
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
# Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license
|
||||
|
||||
import os
|
||||
from typing import Tuple
|
||||
|
||||
|
||||
def convert_verify_to_cafile_and_capath(
|
||||
verify: bool | str,
|
||||
) -> Tuple[str | None, str | None]:
|
||||
cafile: str | None = None
|
||||
capath: str | None = None
|
||||
if isinstance(verify, str):
|
||||
if os.path.isfile(verify):
|
||||
cafile = verify
|
||||
elif os.path.isdir(verify):
|
||||
capath = verify
|
||||
else:
|
||||
raise ValueError("invalid verify string")
|
||||
return cafile, capath
|
||||
Loading…
Add table
Add a link
Reference in a new issue