mirror of
https://github.com/lilydjwg/fcitx.vim.git
synced 2025-12-27 02:24:57 +08:00
there is no _EXIT_ in socket in python2
This commit is contained in:
parent
3a69ec3ff6
commit
5b33e919d9
1 changed files with 2 additions and 1 deletions
|
|
@ -4,6 +4,7 @@ import os
|
|||
import vim
|
||||
import socket
|
||||
import struct
|
||||
import contextlib
|
||||
|
||||
fcitxsocketfile = vim.eval('s:fcitxsocketfile')
|
||||
|
||||
|
|
@ -48,7 +49,7 @@ class FcitxComm(object):
|
|||
if not self._connect():
|
||||
return
|
||||
|
||||
with self.sock:
|
||||
with contextlib.closing(self.sock):
|
||||
try:
|
||||
return func(*args, **kwargs)
|
||||
except (socket.error, socket.timeout, struct.error) as e:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue