Skip to content

Commit 31d8c9c

Browse files
committed
Replace deprecated importlib.resources.path call with importlib.resources.file
1 parent ba8c549 commit 31d8c9c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

checkdmarc/bimi.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@
1414
import hashlib
1515

1616
try:
17-
import importlib.resources as pkg_resources
17+
from importlib.resources import files
1818
except ImportError:
19-
# Try backported to PY<37 `importlib_resources`
20-
import importlib_resources as pkg_resources
19+
# Try backported to PY<3 `importlib_resources`
20+
from importlib.resources import files
21+
2122

2223
import dns
2324
import requests
@@ -60,7 +61,7 @@
6061

6162
# Load the certificates included in MVACAs.pem into a certificate store
6263
X509STORE = X509Store()
63-
with pkg_resources.path(checkdmarc.resources, "MVACAs.pem") as path:
64+
with str(files(checkdmarc.resources).joinpath("MVACAs.pem")) as path:
6465

6566
CA_PEMS = pem.parse_file(path)
6667
for CA_PEM in CA_PEMS:

0 commit comments

Comments
 (0)