Skip to content

Commit

Permalink
Adjust imports of deprecated sre_* modules in Python 3.11
Browse files Browse the repository at this point in the history
Fixes HypothesisWorks#3309
See python/cpython#91308

I don't see a way to avoid relying on Python 3.11 internals here, so
this instead just adjusts the imports to avoid deprecation warnings.
  • Loading branch information
The-Compiler committed Apr 26, 2022
1 parent c0e249c commit 66ca462
Showing 1 changed file with 7 additions and 2 deletions.
Expand Up @@ -10,8 +10,13 @@

import operator
import re
import sre_constants as sre
import sre_parse

try: # pragma: no cover
import re._constants as sre
import re._parser as sre_parse
except ImportError: # Python < 3.11
import sre_constants as sre # type: ignore
import sre_parse # type: ignore

from hypothesis import reject, strategies as st
from hypothesis.internal.charmap import as_general_categories, categories
Expand Down

0 comments on commit 66ca462

Please sign in to comment.