Skip to content

Commit

Permalink
fix an event manager crash
Browse files Browse the repository at this point in the history
  • Loading branch information
Brendan Taylor committed Sep 20, 2011
1 parent 4221eea commit 0ef9a6c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions bin/uzbl-event-manager
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ from itertools import count
from optparse import OptionParser
from select import select
from signal import signal, SIGTERM, SIGINT, SIGKILL
from socket import socket, AF_UNIX, SOCK_STREAM
from socket import socket, AF_UNIX, SOCK_STREAM, error as socket_error
from traceback import format_exc


Expand Down Expand Up @@ -370,7 +370,7 @@ class Uzbl(object):
data = ''.join(self.child_buffer)
try:
bsent = self.child_socket.send(data)
except socket.error as e:
except socket_error as e:
if e.errno in (errno.EAGAIN, errno.EINTR):
self.child_buffer = [data]
return
Expand Down Expand Up @@ -625,13 +625,13 @@ class UzblEventDaemon(object):
self.uzbls[child_socket] = Uzbl(self, child_socket)
connections += 1

for uzbl in [self.uzbls[s] for s in writes]:
for uzbl in [self.uzbls[s] for s in writes if s in self.uzbls ]:
uzbl.do_send()

for uzbl in [self.uzbls[s] for s in reads]:
for uzbl in [self.uzbls[s] for s in reads if s in self.uzbls]:
uzbl.read()

for uzbl in [self.uzbls[s] for s in errors]:
for uzbl in [self.uzbls[s] for s in errors if s in self.uzbls]:
uzbl.logger.error('socket read error')
uzbl.close()

Expand Down

0 comments on commit 0ef9a6c

Please sign in to comment.