Skip to content

Commit

Permalink
alerts: make it compatible with Python3.8 (#838)
Browse files Browse the repository at this point in the history
Summary:
`re.Pattern[str]` is not valid in Python 3.8

Pull Request resolved: #838

Test Plan:
```
Python 3.8.17 (default, Jul  9 2023, 20:57:35)
[Clang 14.0.3 (clang-1403.0.22.14.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import re
>>> from typing import Optional
>>> show_after_crashes_regex: Optional[re.Pattern[str]] = None
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'type' object is not subscriptable
>>> show_after_crashes_regex: Optional[re.Pattern] = None
>>>
```

Reviewed By: zzl0

Differential Revision: D53903964

fbshipit-source-id: 412f4ad5d6011b0da70c47f31f6c919b9c6a8037
  • Loading branch information
zzl0 authored and facebook-github-bot committed Feb 20, 2024
1 parent 585a276 commit 3e81997
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion eden/scm/sapling/alerts.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Alert(NamedTuple):
description: str
key: str
show_in_isl: bool
show_after_crashes_regex: Optional[re.Pattern[str]]
show_after_crashes_regex: Optional[re.Pattern]


def parse_alert(ui, key: str, raw_alert: dict) -> Optional[Alert]:
Expand Down

0 comments on commit 3e81997

Please sign in to comment.