Skip to content

Commit

Permalink
Only suppress sre_x modules if re._x modules exist
Browse files Browse the repository at this point in the history
  • Loading branch information
gb119 committed Dec 24, 2023
1 parent 2d9dad0 commit 0be6a44
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Stoner/compat.py
Expand Up @@ -40,10 +40,12 @@
sp_version = version_parse(sp.__version__)
mpl_version = version_parse(matplotlib.__version__)

modules["sre_parse"] = re._parser
modules["sre_constants"] = re._constants
modules["sre_compile"] = re._compiler

try: # This only works in PY 3.11 onwards
modules["sre_parse"] = re._parser
modules["sre_constants"] = re._constants
modules["sre_compile"] = re._compiler
except AttributeError:
pass

try:
import hyperspy as hs # Workaround an issue in hs 1.5.2 conda packages
Expand Down

0 comments on commit 0be6a44

Please sign in to comment.