We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f5373c9 commit 66e1656Copy full SHA for 66e1656
weasyprint/pdf/pdfa.py
@@ -1,7 +1,16 @@
1
"""PDF/A generation."""
2
3
+try:
4
+ # Available in Python 3.9+
5
+ from importlib.resources import files
6
+except ImportError:
7
+ # Deprecated in Python 3.11+
8
+ from importlib.resources import read_binary
9
+else:
10
+ def read_binary(package, resource):
11
+ return (files(package) / resource).read_bytes()
12
+
13
from functools import partial
-from importlib.resources import read_binary
14
15
import pydyf
16
0 commit comments