File tree Expand file tree Collapse file tree 2 files changed +39
-20
lines changed
Expand file tree Collapse file tree 2 files changed +39
-20
lines changed Original file line number Diff line number Diff line change 1717
1818import re
1919import sys
20-
21- from sre_parse import ( # pylint: disable=E0611
22- parse ,
23- AT ,
24- AT_BEGINNING ,
25- AT_BEGINNING_STRING ,
26- AT_END ,
27- AT_END_STRING ,
28- BRANCH ,
29- SUBPATTERN ,
30- )
20+ if sys .version_info >= (3 , 11 ):
21+ from re ._parser import ( # pylint: disable=E0611
22+ parse ,
23+ AT ,
24+ AT_BEGINNING ,
25+ AT_BEGINNING_STRING ,
26+ AT_END ,
27+ AT_END_STRING ,
28+ )
29+ else :
30+ from sre_parse import ( # pylint: disable=E0611
31+ parse ,
32+ AT ,
33+ AT_BEGINNING ,
34+ AT_BEGINNING_STRING ,
35+ AT_END ,
36+ AT_END_STRING ,
37+ )
3138
3239from st2common .util .jinja import render_values
3340from st2common .constants import keyvalue as kv_constants
Original file line number Diff line number Diff line change 1- # Copyright 2020 The StackStorm Authors.
1+ # Copyright 2020-2026 The StackStorm Authors.
22# Copyright 2019 Extreme Networks, Inc.
33#
44# Licensed under the Apache License, Version 2.0 (the "License");
1414# limitations under the License.
1515
1616from __future__ import absolute_import
17- from sre_parse import (
18- parse ,
19- AT ,
20- AT_BEGINNING ,
21- AT_BEGINNING_STRING ,
22- AT_END ,
23- AT_END_STRING ,
24- )
17+
18+ import sys
19+ if sys .version_info >= (3 , 11 ):
20+ from re ._parser import (
21+ parse ,
22+ AT ,
23+ AT_BEGINNING ,
24+ AT_BEGINNING_STRING ,
25+ AT_END ,
26+ AT_END_STRING ,
27+ )
28+ else :
29+ from sre_parse import (
30+ parse ,
31+ AT ,
32+ AT_BEGINNING ,
33+ AT_BEGINNING_STRING ,
34+ AT_END ,
35+ AT_END_STRING ,
36+ )
2537from mock import Mock
2638from unittest import TestCase
2739from st2common .exceptions .content import ParseException
You can’t perform that action at this time.
0 commit comments