sys.tracebacklimit

Vlad Didenko vdidenko at Getcollc.com
Wed Jul 13 15:42:34 CEST 2011


Colleagues,

Per documentation at http://docs.python.org/py3k/library/sys.html#sys.tracebacklimit :

     When [sys.tracebacklimit] set to 0 or less, all traceback information is suppressed and only the exception type and value are printed

So, I expect to be able to have a program like:

    import sys
    sys.tracebacklimit=0
    print(1/0)

And see it's result as:

     ZeroDivisionError: division by zero

However, the actual result is:

     Traceback (most recent call last):
       File "tbt.py", line 3, in <module>
         print(1/0)
     ZeroDivisionError: division by zero

Do I misunderstand the docs?

Thank you!
Vlad

________________________________
This e-mail and its attachments are intended only for the individual or entity to whom it is addressed and may contain information that is confidential, privileged, inside information, or subject to other restrictions on use or disclosure. Any unauthorized use, dissemination or copying of this transmission or the information in it is prohibited and may be unlawful. If you have received this transmission in error, please notify the sender immediately by return e-mail, and permanently delete or destroy this e-mail, any attachments, and all copies (digital or paper). Unless expressly stated in this e-mail, nothing in this message should be construed as a digital or electronic signature.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20110713/0c98f604/attachment.html>


More information about the Python-list mailing list