Commit bec8cba
authored
Fix crash when missing format character (python#20524)
Fixes python#20523
```
>>> import re
>>> m = re.fullmatch(r"%(?P<type>.)?", "%")
>>> m.groupdict()
{'type': None}
>>> m.groupdict().get("type", "")
>>> m.groupdict().get("type") or ""
''
```1 parent c71fdb0 commit bec8cba
2 files changed
Lines changed: 5 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
| |||
0 commit comments