Commit 11297e06 authored by Denis Bilenko's avatar Denis Bilenko

server.py: remove calls to sys.exc_clear() - they should not be necessary

parent df8493be
...@@ -113,7 +113,6 @@ class StreamServer(BaseServer): ...@@ -113,7 +113,6 @@ class StreamServer(BaseServer):
client_socket, address = self.socket.accept() client_socket, address = self.socket.accept()
except socket.error, err: except socket.error, err:
if err[0] == errno.EAGAIN: if err[0] == errno.EAGAIN:
sys.exc_clear()
return return
raise raise
self.delay = self.min_delay self.delay = self.min_delay
...@@ -127,7 +126,6 @@ class StreamServer(BaseServer): ...@@ -127,7 +126,6 @@ class StreamServer(BaseServer):
except: except:
traceback.print_exc() traceback.print_exc()
ex = sys.exc_info()[1] ex = sys.exc_info()[1]
sys.exc_clear()
if self.is_fatal_error(ex): if self.is_fatal_error(ex):
self.kill() self.kill()
sys.stderr.write('ERROR: %s failed with %s\n' % (self, str(ex) or repr(ex))) sys.stderr.write('ERROR: %s failed with %s\n' % (self, str(ex) or repr(ex)))
...@@ -143,7 +141,6 @@ class StreamServer(BaseServer): ...@@ -143,7 +141,6 @@ class StreamServer(BaseServer):
self.stop_accepting() self.stop_accepting()
self._start_accepting_timer = core.timer(self.delay, self.start_accepting) self._start_accepting_timer = core.timer(self.delay, self.start_accepting)
self.delay = min(self.max_delay, self.delay * 2) self.delay = min(self.max_delay, self.delay * 2)
sys.exc_clear()
def is_fatal_error(self, ex): def is_fatal_error(self, ex):
return isinstance(ex, socket.error) and ex[0] in (errno.EBADF, errno.EINVAL, errno.ENOTSOCK) return isinstance(ex, socket.error) and ex[0] in (errno.EBADF, errno.EINVAL, errno.ENOTSOCK)
......
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