Commit 9213da4c authored by Vincent Pelletier's avatar Vincent Pelletier

Remove unexplained try..except blocks.

Hiding exceptions is *bad* .

git-svn-id: https://svn.erp5.org/repos/neo/trunk@1561 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 366205da
...@@ -227,40 +227,28 @@ class EpollEventManager(object): ...@@ -227,40 +227,28 @@ class EpollEventManager(object):
pass pass
def addReader(self, conn): def addReader(self, conn):
try:
fd = conn.getConnector().getDescriptor() fd = conn.getConnector().getDescriptor()
if fd not in self.reader_set: if fd not in self.reader_set:
self.reader_set.add(fd) self.reader_set.add(fd)
self.epoll.modify(fd, 1, fd in self.writer_set) self.epoll.modify(fd, 1, fd in self.writer_set)
except AttributeError:
pass
def removeReader(self, conn): def removeReader(self, conn):
try:
fd = conn.getConnector().getDescriptor() fd = conn.getConnector().getDescriptor()
if fd in self.reader_set: if fd in self.reader_set:
self.reader_set.remove(fd) self.reader_set.remove(fd)
self.epoll.modify(fd, 0, fd in self.writer_set) self.epoll.modify(fd, 0, fd in self.writer_set)
except AttributeError:
pass
def addWriter(self, conn): def addWriter(self, conn):
try:
fd = conn.getConnector().getDescriptor() fd = conn.getConnector().getDescriptor()
if fd not in self.writer_set: if fd not in self.writer_set:
self.writer_set.add(fd) self.writer_set.add(fd)
self.epoll.modify(fd, fd in self.reader_set, 1) self.epoll.modify(fd, fd in self.reader_set, 1)
except AttributeError:
pass
def removeWriter(self, conn): def removeWriter(self, conn):
try:
fd = conn.getConnector().getDescriptor() fd = conn.getConnector().getDescriptor()
if fd in self.writer_set: if fd in self.writer_set:
self.writer_set.remove(fd) self.writer_set.remove(fd)
self.epoll.modify(fd, fd in self.reader_set, 0) self.epoll.modify(fd, fd in self.reader_set, 0)
except AttributeError:
pass
# Default to EpollEventManager. # Default to EpollEventManager.
EventManager = EpollEventManager EventManager = EpollEventManager
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment