diff --git a/rstr/xeger.py b/rstr/xeger.py index cc348ec..0a68711 100644 --- a/rstr/xeger.py +++ b/rstr/xeger.py @@ -1,5 +1,4 @@ import random -import sre_parse import string from itertools import chain import typing @@ -10,6 +9,11 @@ if typing.TYPE_CHECKING: from rstr.rstr_base import _Random +try: + import re._parser as sre_parse +except ImportError: # Python < 3.11 + import sre_parse # type: ignore + # The * and + characters in a regular expression # match up to any number of repeats in theory,