summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authoramajorek <devnull@localhost>2010-02-28 14:53:07 -0500
committeramajorek <devnull@localhost>2010-02-28 14:53:07 -0500
commit41ef54f57041473f1d1984ab8f6e58daea1709bc (patch)
tree5bd6ee60aae52a838f51da2366c141c3197a9b04 /examples
parent44b615c8d3a672890c9d930e553a6eedc6b04d5a (diff)
downloadeventlet-41ef54f57041473f1d1984ab8f6e58daea1709bc.tar.gz
New eventlet.common module to create version-neutral layer. For now only get_errno added there.
All usage of e[0] replaced with either get_errno(e) or e.args[0] if intnetion was not to extract errno, but first argument
Diffstat (limited to 'examples')
-rw-r--r--examples/websocket.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/websocket.py b/examples/websocket.py
index 2cef80c..fca2fa7 100644
--- a/examples/websocket.py
+++ b/examples/websocket.py
@@ -3,6 +3,7 @@ import errno
from eventlet import wsgi
from eventlet import pools
import eventlet
+from eventlet.common import get_errno
class WebSocketWSGI(object):
def __init__(self, handler, origin):
@@ -37,7 +38,7 @@ class WebSocketWSGI(object):
try:
self.handler(ws)
except socket.error, e:
- if wsgi.get_errno(e) != errno.EPIPE:
+ if get_errno(e) != errno.EPIPE:
raise
# use this undocumented feature of eventlet.wsgi to ensure that it
# doesn't barf on the fact that we didn't call start_response
@@ -138,4 +139,4 @@ def dispatch(environ, start_response):
if __name__ == "__main__":
# run an example app from the command line
listener = eventlet.listen(('localhost', 7000))
- wsgi.server(listener, dispatch) \ No newline at end of file
+ wsgi.server(listener, dispatch)