Skip to content

Commit a86a487

Browse files
committed
Fix deprecation warn
1 parent 0c11e36 commit a86a487

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

jsonmodels/utilities.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import re
2-
import sre_constants
32
from collections import namedtuple
43

54
SCALAR_TYPES = tuple(list((str,)) + [int, float, bool])
@@ -97,10 +96,10 @@ def is_ecma_regex(regex):
9796

9897
try:
9998
re.compile(regex)
100-
except sre_constants.error as err:
99+
except re.error as err:
101100
raise ValueError(
102101
f"Given regex {regex} isn't ECMA regex nor Python regex: {err}."
103-
)
102+
) from err
104103
return False
105104

106105

tests/test_project.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def test_pep8_and_complexity():
2626
not tests.LINT or not tests.CHECK_SPELLING, reason="No spelling check."
2727
)
2828
def test_docs():
29-
run("sphinx-build -b spelling -d docs/_build/doctress " "docs docs/build/spelling")
29+
run("sphinx-build -b spelling -d docs/_build/doctress docs docs/build/spelling")
3030

3131

3232
def _collect_static(dirs):

0 commit comments

Comments
 (0)