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.

Author kuraga
Recipients kuraga
Date 2019-10-30.09:21:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1572427266.54.0.98752253476.issue38638@roundup.psfhosted.org>
In-reply-to
Content
class CM:

    def __init__(self):
        pass

    def __enter__(self):
        return self

    def __exit__(self, exc_type, exc_val, exc_tb):
        raise RuntimeError()

if __name__ == '__main__':
    with CM() as cm:
        print('Hello')


$ python3 cm.py 
Hello
Traceback (most recent call last):
  File "cm.py", line 14, in <module>
    print('Hello')  # <--
  File "cm.py", line 10, in __exit__
    raise RuntimeError()
RuntimeError


Is it correct that print presents in backtrace? Well it's the last line but...

Thanks.
History
Date User Action Args
2019-10-30 09:21:06kuragasetrecipients: + kuraga
2019-10-30 09:21:06kuragasetmessageid: <1572427266.54.0.98752253476.issue38638@roundup.psfhosted.org>
2019-10-30 09:21:06kuragalinkissue38638 messages
2019-10-30 09:21:05kuragacreate