Skip to content

Commit 16b5922

Browse files
svalentinValentin Stanciupre-commit-ci[bot]hauntsaninja
authored
Mark ErrorCodes as serializable (#15218)
When starting mypy daemon, we pickle options. Error codes are part of options and need to be pickle-able. This decorator is needed for this to be possible with mypyc. Fixes #14671 --------- Co-authored-by: Valentin Stanciu <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Shantanu <[email protected]>
1 parent fe7007f commit 16b5922

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

mypy/errorcodes.py

+3
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,13 @@
88
from collections import defaultdict
99
from typing_extensions import Final
1010

11+
from mypy_extensions import mypyc_attr
12+
1113
error_codes: dict[str, ErrorCode] = {}
1214
sub_code_map: dict[str, set[str]] = defaultdict(set)
1315

1416

17+
@mypyc_attr(serializable=True)
1518
class ErrorCode:
1619
def __init__(
1720
self,

0 commit comments

Comments
 (0)