Skip to content

Commit e10a5da

Browse files
committed
Fixes #61, use re submodules instead of sre_{parse,constants}
1 parent 0a76982 commit e10a5da

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Changed
11+
12+
- Use `re` submodules instead of `sre_parse` and `sre_constants` ([#61](https://github.com/dlint-py/dlint/issues/61))
13+
1014
## [0.16.0] - 2024-10-31
1115

1216
### Added

dlint/redos/detect.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
#!/usr/bin/env python
22

3-
import sre_constants
4-
import sre_parse
5-
63
import collections
74
import itertools
85
import sys
96

7+
if sys.version_info >= (3, 11):
8+
import re._constants as sre_constants
9+
import re._parser as sre_parse
10+
else:
11+
import sre_constants
12+
import sre_parse
13+
1014
CR = collections.namedtuple('CR', ['cr_min', 'cr_max'])
1115

1216
CATEGORY_TO_RANGE = {

0 commit comments

Comments
 (0)