there is no _EXIT_ in socket in python2

This commit is contained in:
gou4shi1 2017-05-15 19:07:15 +08:00
parent 3a69ec3ff6
commit 5b33e919d9

View file

@ -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: