python: Use Pattern from typing
Python <3.7 must import Pattern from typing not re Change-Id: I56acb466aef40b7188e4cd58d3ba5d0b0cc9b090 Signed-off-by: Jason Lowe-Power <jason@lowepower.com> Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/42643 Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu> Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu> Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
committed by
Jason Lowe-Power
parent
ee1837d313
commit
89ec39a147
@@ -25,7 +25,7 @@
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
import re
|
||||
from typing import Callable, Dict, Iterator, List, Optional, Union
|
||||
from typing import Callable, Dict, Iterator, List, Optional, Pattern, Union
|
||||
|
||||
from .jsonserializable import JsonSerializable
|
||||
from .statistic import Scalar, Statistic
|
||||
@@ -99,7 +99,7 @@ class Group(JsonSerializable):
|
||||
"""
|
||||
yield from self.children(lambda _name: _name in name)
|
||||
|
||||
def find_re(self, regex: Union[str, re.Pattern]
|
||||
def find_re(self, regex: Union[str, Pattern]
|
||||
) -> Iterator[Union["Group", Statistic]]:
|
||||
""" Find all stats that match the name
|
||||
|
||||
|
||||
Reference in New Issue
Block a user