summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
Diffstat (limited to 'Lib')
-rw-r--r--Lib/SimpleXMLRPCServer.py4
-rw-r--r--Lib/idlelib/WindowList.py4
-rw-r--r--Lib/lib-tk/Tkinter.py2
-rw-r--r--Lib/traceback.py4
4 files changed, 6 insertions, 8 deletions
diff --git a/Lib/SimpleXMLRPCServer.py b/Lib/SimpleXMLRPCServer.py
index 052a8e4..156c2ba 100644
--- a/Lib/SimpleXMLRPCServer.py
+++ b/Lib/SimpleXMLRPCServer.py
@@ -261,7 +261,7 @@ class SimpleXMLRPCDispatcher:
except:
# report exception back to server
response = xmlrpclib.dumps(
- xmlrpclib.Fault(1, "%s:%s" % (sys.exc_type, sys.exc_value)),
+ xmlrpclib.Fault(1, "%s:%s" % sys.exc_info()[:2]),
encoding=self.encoding, allow_none=self.allow_none,
)
@@ -362,7 +362,7 @@ class SimpleXMLRPCDispatcher:
except:
results.append(
{'faultCode' : 1,
- 'faultString' : "%s:%s" % (sys.exc_type, sys.exc_value)}
+ 'faultString' : "%s:%s" % sys.exc_info()[:2]}
)
return results
diff --git a/Lib/idlelib/WindowList.py b/Lib/idlelib/WindowList.py
index 658502b..d0123d8 100644
--- a/Lib/idlelib/WindowList.py
+++ b/Lib/idlelib/WindowList.py
@@ -45,8 +45,8 @@ class WindowList:
try:
callback()
except:
- print "warning: callback failed in WindowList", \
- sys.exc_type, ":", sys.exc_value
+ t, v, tb = sys.exc_info()
+ print "warning: callback failed in WindowList", t, ":", v
registry = WindowList()
diff --git a/Lib/lib-tk/Tkinter.py b/Lib/lib-tk/Tkinter.py
index 37ddd3a..d600cd7 100644
--- a/Lib/lib-tk/Tkinter.py
+++ b/Lib/lib-tk/Tkinter.py
@@ -1108,7 +1108,7 @@ class Misc:
def _report_exception(self):
"""Internal function."""
import sys
- exc, val, tb = sys.exc_type, sys.exc_value, sys.exc_traceback
+ exc, val, tb = sys.exc_info()
root = self._root()
root.report_callback_exception(exc, val, tb)
def _configure(self, cmd, cnf, kw):
diff --git a/Lib/traceback.py b/Lib/traceback.py
index 4971906..93a64b7 100644
--- a/Lib/traceback.py
+++ b/Lib/traceback.py
@@ -203,9 +203,7 @@ def _some_str(value):
def print_exc(limit=None, file=None):
- """Shorthand for 'print_exception(sys.exc_type, sys.exc_value, sys.exc_traceback, limit, file)'.
- (In fact, it uses sys.exc_info() to retrieve the same information
- in a thread-safe way.)"""
+ """Shorthand for 'print_exception(*sys.exc_info(), limit, file)'."""
if file is None:
file = sys.stderr
try: