alon horev <alo...@gmail.com> added the comment:

Submitting a patch proposing this format:

-----BEGIN UNRAISABLE EXCEPTION-----
Class: AttributeError
Instance: "'NoneType' object has no attribute 'someattr'"
Function: <bound method A.__del__ of <__main__.A object at 0x1007671d0>>
Traceback (most recent call last):
  File "/tmp/bla.py", line 4, in __del__
    None.someattr
-----END UNRAISABLE EXCEPTION-----

I've wrapped the exception information with header/footer differentiating it 
from a user's error handling code that also prints tracebacks (is it too much?).

I've considered using the warnings module, But I dislike the suppression of 
already warned messages. (2 instances will raise exception in __del__ but only 
one message will be printed) 

This is my first patch submission so feel free giving me a hard time.

----------
keywords: +patch
nosy: +alonho
Added file: http://bugs.python.org/file23413/7317.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue7317>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to