summaryrefslogtreecommitdiffstats
path: root/Demo
diff options
context:
space:
mode:
Diffstat (limited to 'Demo')
-rwxr-xr-xDemo/classes/Complex.py2
-rwxr-xr-xDemo/pdist/server.py2
-rwxr-xr-xDemo/sockets/gopher.py3
3 files changed, 4 insertions, 3 deletions
diff --git a/Demo/classes/Complex.py b/Demo/classes/Complex.py
index 2b306ad..a779897 100755
--- a/Demo/classes/Complex.py
+++ b/Demo/classes/Complex.py
@@ -233,7 +233,7 @@ def checkop(expr, a, b, value, fuzz = 1e-6):
try:
result = eval(expr)
except:
- result = sys.exc_type
+ result = sys.exc_info()[0]
print '->', result
if isinstance(result, str) or isinstance(value, str):
ok = (result == value)
diff --git a/Demo/pdist/server.py b/Demo/pdist/server.py
index e692eea..01b3249 100755
--- a/Demo/pdist/server.py
+++ b/Demo/pdist/server.py
@@ -83,7 +83,7 @@ class Server:
method = getattr(self, methodname)
reply = (None, apply(method, args), id)
except:
- reply = (sys.exc_type, sys.exc_value, id)
+ reply = (sys.exc_info()[:2], id)
if id < 0 and reply[:2] == (None, None):
if self._verbose > 1: print "Suppress reply"
return 1
diff --git a/Demo/sockets/gopher.py b/Demo/sockets/gopher.py
index cd76659..34bcdf0 100755
--- a/Demo/sockets/gopher.py
+++ b/Demo/sockets/gopher.py
@@ -191,7 +191,8 @@ def browse_menu(selector, host, port):
try:
browserfunc(i_selector, i_host, i_port)
except (IOError, socket.error):
- print '***', sys.exc_type, ':', sys.exc_value
+ t, v, tb = sys.exc_info()
+ print '***', t, ':', v
else:
print 'Unsupported object type'