Solving thread cleanup on paramiko

前端 未结 3 1964
时光取名叫无心
时光取名叫无心 2021-01-11 16:02

I have an automated process using paramiko and have this error:

Exception in thread Thread-1 (most likely raised during interpreter 
shutdown)

....
....
<         


        
3条回答
  •  独厮守ぢ
    2021-01-11 16:55

    I now, is not the case. But a find this discussion, searching a problem whit my wxpython app.

    Solve it to add a close event to the main frame. So all the thread's will be close.

    class MyFrame(wx.Frame):
        def __init__(self, *args, **kwargs):
            super(MyFrame, self).__init__(*args, **kwargs)
    
            # Attributes
            self.panel = MainPanel(self)
    
            # Setup
            path = os.path.abspath("./comix.png")
            icon = wx.Icon(path, wx.BITMAP_TYPE_PNG)
            self.SetIcon(icon)
    
            # Layout
            sizer = wx.BoxSizer(wx.VERTICAL)
            sizer.Add(self.panel, 1, wx.EXPAND)
            self.SetSizer(sizer)
    
            self.CreateStatusBar()
            # Event Handlers
            self.Bind(wx.EVT_CLOSE, self.OnClose)
    
       def OnClose(self, event):
            ssh.close()
            winssh.close()
            event.Skip()
    

    I hope this cant help to anyone.

提交回复
热议问题