Skip to content

Commit

Permalink
xeger: avoid deprecated sre_parse module in python-3.11+
Browse files Browse the repository at this point in the history
The undocumented sre_parse module got deprecated in Python 3.11 which leads
to build/test failures on Linux distributions making use of this version, e.g.
Ubuntu 23.04.

See bpo-47152: python/cpython#91308
  • Loading branch information
slyon committed Nov 8, 2022
1 parent 20886b3 commit e5367cf
Showing 1 changed file with 5 additions and 1 deletion.
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

0 comments on commit e5367cf

Please sign in to comment.