diff --git a/docxcompose/properties.py b/docxcompose/properties.py index aa8cd2d..51f2ac0 100644 --- a/docxcompose/properties.py +++ b/docxcompose/properties.py @@ -15,7 +15,7 @@ from lxml.etree import QName from six import binary_type from six import text_type -import pkg_resources +import importlib.resources as importlib_resources import re @@ -108,8 +108,8 @@ def __init__(self, doc): self._element = parse_xml(part.blob) def _part_template(self): - return pkg_resources.resource_string( - 'docxcompose', 'templates/custom.xml') + ref = importlib_resources.files('docxcompose').joinpath('templates/custom.xml') + return ref.read_bytes() def _update_part(self): if self.part is None: