This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: sys.last_type is missing
Type: Stage:
Components: Library (Lib) Versions: Python 2.2
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: complex, gvanrossum
Priority: normal Keywords:

Created on 2003-02-20 15:46 by complex, last changed 2022-04-10 16:06 by admin. This issue is now closed.

Messages (2)
msg14706 - (view) Author: Viktor Ferenczi (complex) Date: 2003-02-20 15:46
ActivePython 2.2.1 Build 222 (ActiveState Corp.) based on
Python 2.2.1 (#34, Apr 15 2002, 09:51:39) [MSC 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from traceback import print_last
>>> try: dffddf
... except: print_last()
...
Traceback (most recent call last):
  File "<stdin>", line 2, in ?
  File "C:\Python\lib\traceback.py", line 219, in print_last
    print_exception(sys.last_type, sys.last_value, sys.last_traceback,
AttributeError: 'module' object has no attribute 'last_type'
>>>
msg14707 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2003-02-23 14:08
Logged In: YES 
user_id=6380

You're looking for exc_type, not last_type. last_type is
only set when an exception is *not* caught.
History
Date User Action Args
2022-04-10 16:06:57adminsetgithub: 38015
2003-02-20 15:46:59complexcreate