File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 55This module returns the installation location of cacert.pem or its contents.
66"""
77import sys
8+ import atexit
9+
10+ def exit_cacert_ctx () -> None :
11+ _CACERT_CTX .__exit__ (None , None , None ) # type: ignore[union-attr]
812
913
1014if sys .version_info >= (3 , 11 ):
@@ -35,6 +39,7 @@ def where() -> str:
3539 # we will also store that at the global level as well.
3640 _CACERT_CTX = as_file (files ("certifi" ).joinpath ("cacert.pem" ))
3741 _CACERT_PATH = str (_CACERT_CTX .__enter__ ())
42+ atexit .register (exit_cacert_ctx )
3843
3944 return _CACERT_PATH
4045
@@ -70,6 +75,7 @@ def where() -> str:
7075 # we will also store that at the global level as well.
7176 _CACERT_CTX = get_path ("certifi" , "cacert.pem" )
7277 _CACERT_PATH = str (_CACERT_CTX .__enter__ ())
78+ atexit .register (exit_cacert_ctx )
7379
7480 return _CACERT_PATH
7581
You can’t perform that action at this time.
0 commit comments