diff --git a/dosagelib/plugins/comicskingdom.py b/dosagelib/plugins/comicskingdom.py index 48cf54b65..5ced8fa49 100644 --- a/dosagelib/plugins/comicskingdom.py +++ b/dosagelib/plugins/comicskingdom.py @@ -1,7 +1,10 @@ # SPDX-License-Identifier: MIT -# Copyright (C) 2019-2022 Tobias Gruetzmacher -# Copyright (C) 2019 Thomas W. Littauer -from importlib.resources import path as get_path +# SPDX-FileCopyrightText: © 2019 Tobias Gruetzmacher +# SPDX-FileCopyrightText: © 2019 Thomas W. Littauer +try: + from importlib_resources import as_file, files +except ImportError: + from importlib.resources import as_file, files from ..helpers import bounceStarter, joinPathPartsNamer from ..scraper import ParserScraper @@ -25,7 +28,7 @@ class ComicsKingdom(ParserScraper): # slightly iffy hack taken from certifi # We need or own certificate bundle since ComicsKingdom screws up their # TLS setup from time to time, this should "fix" it) - self.cert_ctx = get_path('dosagelib.data', 'godaddy-bundle-g2-2031.pem') + self.cert_ctx = as_file(files('dosagelib.data') / 'godaddy-bundle-g2-2031.pem') self.session.add_host_options('comicskingdom.com', { 'verify': str(self.cert_ctx.__enter__()), }) diff --git a/pyproject.toml b/pyproject.toml index 8e935c4b2..923f77874 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,6 +35,7 @@ dependencies = [ "requests>=2.0", "cached_property;python_version<'3.8'", "importlib_metadata;python_version<'3.8'", + "importlib_resources>=5.0.0;python_version<'3.9'", ] dynamic = ["version"]