Skip to content

Commit 73f27b3

Browse files
use read_text()
Co-authored-by: Adam Turner <[email protected]>
1 parent 5c675e1 commit 73f27b3

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

certifi/core.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,13 @@ def where() -> str:
3838

3939
return _CACERT_PATH
4040

41+
42+
def contents() -> str:
43+
return files("certifi").joinpath("cacert.pem").read_text(encoding="ascii")
44+
4145
else:
4246

43-
from importlib.resources import path as get_path
47+
from importlib.resources import path as get_path, read_text
4448

4549
_CACERT_CTX = None
4650
_CACERT_PATH = None
@@ -71,6 +75,9 @@ def where() -> str:
7175
return _CACERT_PATH
7276

7377

78+
def contents() -> str:
79+
return read_text("certifi", "cacert.pem", encoding="ascii")
80+
7481
def contents() -> str:
7582
with open(where(), "r", encoding="ascii") as fp:
7683
return fp.read()

0 commit comments

Comments
 (0)