diff --git a/jsonmodels/utilities.py b/jsonmodels/utilities.py index 0e18eb8..811bd70 100644 --- a/jsonmodels/utilities.py +++ b/jsonmodels/utilities.py @@ -1,5 +1,4 @@ import re -import sre_constants from collections import namedtuple SCALAR_TYPES = tuple(list((str,)) + [int, float, bool]) @@ -97,10 +96,10 @@ def is_ecma_regex(regex): try: re.compile(regex) - except sre_constants.error as err: + except re.error as err: raise ValueError( f"Given regex {regex} isn't ECMA regex nor Python regex: {err}." - ) + ) from err return False diff --git a/tests/test_project.py b/tests/test_project.py index 12e4b9e..cd54547 100644 --- a/tests/test_project.py +++ b/tests/test_project.py @@ -26,7 +26,7 @@ def test_pep8_and_complexity(): not tests.LINT or not tests.CHECK_SPELLING, reason="No spelling check." ) def test_docs(): - run("sphinx-build -b spelling -d docs/_build/doctress " "docs docs/build/spelling") + run("sphinx-build -b spelling -d docs/_build/doctress docs docs/build/spelling") def _collect_static(dirs):