File tree Expand file tree Collapse file tree 2 files changed +45
-26
lines changed
Expand file tree Collapse file tree 2 files changed +45
-26
lines changed 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");
1717
1818import re
1919import sys
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+ BRANCH ,
29+ SUBPATTERN ,
30+ )
31+ else :
32+ from sre_parse import ( # pylint: disable=E0611
33+ parse ,
34+ AT ,
35+ AT_BEGINNING ,
36+ AT_BEGINNING_STRING ,
37+ AT_END ,
38+ AT_END_STRING ,
39+ BRANCH ,
40+ SUBPATTERN ,
41+ )
2042
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- )
3143
3244from st2common .util .jinja import render_values
3345from st2common .constants import keyvalue as kv_constants
4557
4658LOG = log .getLogger (__name__ )
4759
48- # Python 3 compatibility
49- if sys .version_info > (3 ,):
50- SUBPATTERN_INDEX = 3
51- else :
52- SUBPATTERN_INDEX = 1
53-
60+ SUBPATTERN_INDEX = 3
5461
5562class ActionAliasFormatParser (object ):
5663 def __init__ (self , alias_format = None , param_stream = None ):
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