Skip to content

Commit e3505b1

Browse files
committed
Fix clear.
1 parent c21aa45 commit e3505b1

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

jupyter_rtc_core/outputs/manager.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -119,15 +119,15 @@ def write_stream(self, file_id, cell_id, output) -> Map:
119119
placeholder = None
120120
return placeholder
121121

122-
123-
124-
125-
126-
127-
128122
def clear(self, file_id, cell_id=None):
129-
path = self._build_path(file_id, cell_id)
123+
"""Clear the state of the manager."""
124+
if cell_id is None:
125+
self._stream_count = {}
126+
path = self._build_path(file_id)
127+
else:
128+
try:
129+
del self._stream_count[cell_id]
130+
except KeyError:
131+
pass
132+
path = self._build_path(file_id, cell_id)
130133
shutil.rmtree(path)
131-
132-
133-

0 commit comments

Comments
 (0)