changeset 17:7b652e2ac62e

added some code to make the example still work if the client isn't connected to the internet.
author Atul Varma <varmaa@toolness.com>
date Sun, 19 Apr 2009 20:29:17 -0700
parents 4b3a30d863cc
children 69efb6cdc127
files example.py
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/example.py	Sun Apr 19 14:43:06 2009 -0700
+++ b/example.py	Sun Apr 19 20:29:17 2009 -0700
@@ -57,6 +57,10 @@
 if __name__ == '__main__':
     server = CoroutineSocketServer(('127.0.0.1', 8071),
                                    example_http_server_coroutine)
-    client = CoroutineSocketClient(('www.google.com', 80),
-                                   example_http_client_coroutine)
+    try:
+        client = CoroutineSocketClient(('www.google.com', 80),
+                                       example_http_client_coroutine)
+    except:
+        import traceback
+        traceback.print_exc()
     server.run()