Skip to content

Commit 82529d8

Browse files
committed
windows: fix file editing
tornado's asnycio patch does not take nonexisting file descriptors very well, so we need to catch errors here.
1 parent 9688618 commit 82529d8

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

mitmproxy/contrib/urwid/raw_display.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,10 @@ def unhook_event_loop(self, event_loop):
444444
self._input_thread = None
445445

446446
for handle in self._current_event_loop_handles:
447-
event_loop.remove_watch_file(handle)
447+
try:
448+
event_loop.remove_watch_file(handle)
449+
except KeyError:
450+
pass
448451

449452
if self._input_timeout:
450453
event_loop.remove_alarm(self._input_timeout)

0 commit comments

Comments
 (0)