Skip to content

Commit c1ac48d

Browse files
fix(pformat): Fix pformat.py bug (another one)
1 parent 3e778f2 commit c1ac48d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

util/pformat.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ def _fmt_inner(self, dest: Dest, indent: int, ctx: ContextStack, o: object,
8989
if isinstance(o, dict):
9090
return self._fmt_dict(dest, indent, ctx, o, indent_start)
9191
if isinstance(o, frozenset):
92+
if len(o) == 0:
93+
return self._indented_write(
94+
dest, indent if indent_start else 0, 'frozenset()')
9295
keys = sorted(o, key=_SafeSortKey)
9396
return self._fmt_seq(dest, indent, ctx, keys, 'frozenset({', '})')
9497
# is_dataclass returns True for the class itself so check for that

0 commit comments

Comments
 (0)