Replace pkg_resources with importlib.resources for Python 3.14 compatibility
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import json
|
||||
import pkg_resources
|
||||
from importlib.resources import files
|
||||
|
||||
|
||||
def get_lang():
|
||||
@@ -39,8 +39,7 @@ def _load_iso639():
|
||||
# excerpt form Calibre transform code which is executed during Calibre
|
||||
# build).
|
||||
if _iso639 is None:
|
||||
src = pkg_resources.resource_filename('ebook_converter',
|
||||
'data/iso_639-3.json')
|
||||
src = str(files('ebook_converter').joinpath('data/iso_639-3.json'))
|
||||
|
||||
with open(src, 'rb') as f:
|
||||
root = json.load(f)
|
||||
|
||||
Reference in New Issue
Block a user