Просмотр исходного кода

dnet: fix bug which caused dnet to crash on receiving unhandled mouse input

lunar-mining 2 лет назад
Родитель
Сommit
e5d0aca1f4
2 измененных файлов с 2 добавлено и 2 удалено
  1. 2 0
      bin/dnet/main.py
  2. 0 2
      bin/dnet/view.py

+ 2 - 0
bin/dnet/main.py

@@ -106,6 +106,8 @@ class Dnetview:
         loop.run()
         loop.run()
 
 
     def unhandled_input(self, key):
     def unhandled_input(self, key):
+        if isinstance(key, tuple):
+            return
         if key in ('q'):
         if key in ('q'):
             for task in asyncio.all_tasks():
             for task in asyncio.all_tasks():
                 task.cancel()
                 task.cancel()

+ 0 - 2
bin/dnet/view.py

@@ -38,8 +38,6 @@ class NodeView(urwid.WidgetWrap):
         return True
         return True
 
 
     def keypress(self, size, key):
     def keypress(self, size, key):
-        #if key in ('q'):
-        #    raise urwid.ExitMainLoop()
         return key
         return key
 
 
     def update_w(self):
     def update_w(self):