Skip to content

Commit ec205be

Browse files
authored
Fix Options.__repr__ to not infinite recurse (#4514)
1 parent 321eb8f commit ec205be

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

mypy/options.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,9 @@ def __ne__(self, other: object) -> bool:
178178
return not self == other
179179

180180
def __repr__(self) -> str:
181-
return 'Options({})'.format(pprint.pformat(self.__dict__))
181+
d = dict(self.__dict__)
182+
del d['clone_cache']
183+
return 'Options({})'.format(pprint.pformat(d))
182184

183185
def clone_for_module(self, module: str) -> 'Options':
184186
"""Create an Options object that incorporates per-module options.

0 commit comments

Comments
 (0)