Fwd: sys module does not contain ps1

Chris Angelico rosuav at gmail.com
Fri May 18 13:20:35 EDT 2018


On Sat, May 19, 2018 at 2:51 AM, MRAB <python at mrabarnett.plus.com> wrote:
> I have the same version (Python 3.7.0b3). Here, sys has 'ps1' and 'ps2', but
> not 'last_traceback', 'last_type' or 'last_value'.

They aren't there till they're needed:

$ python3
Python 3.8.0a0 (heads/literal_eval-exception:ddcb2eb331, Feb 21 2018, 04:32:23)
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.last_type
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'sys' has no attribute 'last_type'
>>> sys.last_type
<class 'AttributeError'>

ChrisA



More information about the Python-list mailing list