Clean up uses of some deprecated features.
Reported by Neal Norwitz on python-dev.
diff --git a/Lib/inspect.py b/Lib/inspect.py
index 2b28d8e..38b93bf 100644
--- a/Lib/inspect.py
+++ b/Lib/inspect.py
@@ -769,7 +769,7 @@
try:
1/0
except ZeroDivisionError:
- return sys.exc_traceback.tb_frame.f_back
+ return sys.exc_info()[2].tb_frame.f_back
if hasattr(sys, '_getframe'): currentframe = sys._getframe
@@ -779,4 +779,4 @@
def trace(context=1):
"""Return a list of records for the stack below the current exception."""
- return getinnerframes(sys.exc_traceback, context)
+ return getinnerframes(sys.exc_info()[2], context)