From a6e23864d152facbab1f681c3be701e2af016d28 Mon Sep 17 00:00:00 2001 From: Mark Pilgrim Date: Thu, 13 May 2010 23:50:10 -0400 Subject: [PATCH] sys.exc_info is a function [thanks Petr] --- porting-code-to-python-3-with-2to3.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/porting-code-to-python-3-with-2to3.html b/porting-code-to-python-3-with-2to3.html index dd7b3a1..0690d38 100644 --- a/porting-code-to-python-3-with-2to3.html +++ b/porting-code-to-python-3-with-2to3.html @@ -1169,7 +1169,7 @@ except:

sys.exc_type, sys.exc_value, sys.exc_traceback

-

Python 2 had three variables in the sys module that you could access while an exception was being handled: sys.exc_type, sys.exc_value, sys.exc_traceback. (Actually, these date all the way back to Python 1.) Ever since Python 1.5, these variables have been deprecated in favor of sys.exc_info, which is a tuple that contains all three values. In Python 3, these individual variables have finally gone away; you must use sys.exc_info. +

Python 2 had three variables in the sys module that you could access while an exception was being handled: sys.exc_type, sys.exc_value, sys.exc_traceback. (Actually, these date all the way back to Python 1.) Ever since Python 1.5, these variables have been deprecated in favor of sys.exc_info(), which is a function that returns a tuple those three values. In Python 3, these individual variables have finally gone away; you must use the sys.exc_info() function.
Notes