Replace pkg_resources with importlib.resources for Python 3.14 compatibility

This commit is contained in:
wave1martian
2026-03-08 20:24:24 +01:00
parent c89fc132b8
commit 17c304066a
11 changed files with 32 additions and 44 deletions
@@ -1,6 +1,6 @@
import os
import sys
import pkg_resources
from importlib.resources import files
from lxml import etree
@@ -52,9 +52,8 @@ class LRFInput(InputFormatPlugin):
self.log.info('Converting XML to HTML...')
with open(pkg_resources.
resource_filename('ebook_converter',
'data/lrf.xsl')) as fobj:
with open(str(files('ebook_converter')
.joinpath('data/lrf.xsl'))) as fobj:
# TODO(gryf): change this nonsense to etree.parse() instead.
styledoc = etree.fromstring(fobj.read())
media_type = MediaType()