Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xeger: avoid deprecated sre_parse module in python-3.11+ #28

Merged
merged 3 commits into from
Apr 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion rstr/xeger.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import random
import sre_parse
import string
from itertools import chain
import typing
Expand All @@ -10,6 +9,11 @@
if typing.TYPE_CHECKING:
from rstr.rstr_base import _Random

try:
import re._parser as sre_parse # type: ignore[import]
except ImportError: # Python < 3.11
import sre_parse # type: ignore[no-redef]


# The * and + characters in a regular expression
# match up to any number of repeats in theory,
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = pypy38,pyp39,py37,py38,py39,py310,py311,typing
envlist = pypy38,pypy39,py37,py38,py39,py310,py311,typing
skipsdist = true

[testenv]
Expand Down