Skip to content

Commit 3b326db

Browse files
fix: sre_constants import because of deprecation (#2139)
- `sre_constants` is deprecated, the import statement was updated accordingly ### Description The `re` module sources are being reorganized, see more information: python/cpython#91308 Small fix accommodates changes for all python versions. Co-authored-by: Johannes Köster <[email protected]>
1 parent d93f091 commit 3b326db

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

snakemake/rules.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,17 @@
1111
from snakemake.path_modifier import PATH_MODIFIER_FLAG
1212
import sys
1313
import inspect
14-
import sre_constants
1514
import collections
1615
from urllib.parse import urljoin
1716
from pathlib import Path
1817
from itertools import chain
1918
from functools import partial
2019

20+
try:
21+
import re._constants as sre_constants
22+
except ImportError: # python < 3.11
23+
import sre_constants
24+
2125
from snakemake.io import (
2226
IOFile,
2327
_IOFile,

0 commit comments

Comments
 (0)