diff options
author | Scott Maxwell <scott@codecobblers.com> | 2013-11-19 08:06:35 -0800 |
---|---|---|
committer | Scott Maxwell <scott@codecobblers.com> | 2013-11-19 08:06:35 -0800 |
commit | 25dd096da065b1bc2f35c1a62d8a7055b022818b (patch) | |
tree | 94e87015ebcb83660452c79093e1ac407e360306 /demos/demo.py | |
parent | 3ce336c88b7bfbfad03fab17bff8cb3c3a77176c (diff) |
Change all exceptions to modern format (not Py2.5 compatible)
Diffstat (limited to 'demos/demo.py')
-rwxr-xr-x | demos/demo.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/demos/demo.py b/demos/demo.py index 2f245baf..fff61784 100755 --- a/demos/demo.py +++ b/demos/demo.py @@ -113,8 +113,7 @@ if hostname.find(':') >= 0: try: sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.connect((hostname, port)) -except Exception: - e = sys.exc_info()[1] +except Exception as e: print('*** Connect failed: ' + str(e)) traceback.print_exc() sys.exit(1) @@ -171,8 +170,7 @@ try: chan.close() t.close() -except Exception: - e = sys.exc_info()[1] +except Exception as e: print('*** Caught exception: ' + str(e.__class__) + ': ' + str(e)) traceback.print_exc() try: |