diff --git a/nvchecker_source/httpheader.py b/nvchecker_source/httpheader.py index 57feb46..c7e2368 100644 --- a/nvchecker_source/httpheader.py +++ b/nvchecker_source/httpheader.py @@ -2,7 +2,6 @@ # Copyright (c) 2021 lilydjwg , et al. import re -import sre_constants from nvchecker.api import session, GetVersionError @@ -19,7 +18,7 @@ async def get_version_impl(info): try: regex = re.compile(conf['regex']) - except sre_constants.error as e: + except re.error as e: raise GetVersionError('bad regex', exc_info=e) res = await session.request( diff --git a/nvchecker_source/regex.py b/nvchecker_source/regex.py index 828eaf5..ba21a35 100644 --- a/nvchecker_source/regex.py +++ b/nvchecker_source/regex.py @@ -2,14 +2,13 @@ # Copyright (c) 2013-2020 lilydjwg , et al. import re -import sre_constants from nvchecker.api import session, GetVersionError async def get_version(name, conf, *, cache, **kwargs): try: regex = re.compile(conf['regex']) - except sre_constants.error as e: + except re.error as e: raise GetVersionError('bad regex', exc_info=e) if regex.groups > 1: raise GetVersionError('multi-group regex')