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 santoso.wijaya
Recipients Trundle, michael.foord, pitrou, santoso.wijaya
Date 2011-03-21.22:26:39
SpamBayes Score 9.53503e-07
Marked as misclassified No
Message-id <1300746400.2.0.784325885279.issue11627@psf.upfronthosting.co.za>
In-reply-to
Content
Oddly, this works:

C:\Users\santa>C:\python32\python.exe
Python 3.2 (r32:88445, Feb 20 2011, 21:30:00) [MSC v.1500 64 bit (AMD64)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>> class Foo(Exception):
...     def __new__(*args):
...             obj = object()
...             print('Returning {}'.format(repr(obj)))
...             return obj
...
>>> try:
...     raise Foo
... except Exception as e:
...     print('Got it: {}'.format(repr(e)))
...
Returning <object object at 0x00000000022D26D0>
Returning <object object at 0x000000000254B8E0>
Got it: <object object at 0x000000000254B8E0>
>>> ^Z


But this does not:

C:\Users\santa>C:\python32\python.exe
Python 3.2 (r32:88445, Feb 20 2011, 21:30:00) [MSC v.1500 64 bit (AMD64)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>> class Foo(Exception):
...     def __new__(*args):
...             obj = object()
...             print('Returning', repr(obj))
...             return obj
...
>>> try:
...     raise Foo
... except Exception as e:
...     print('Got it:', repr(e))
...
Returning <object object at 0x00000000022F36D0>
Returning <object object at 0x00000000022F38B0>

crash!
History
Date User Action Args
2011-03-21 22:26:40santoso.wijayasetrecipients: + santoso.wijaya, pitrou, michael.foord, Trundle
2011-03-21 22:26:40santoso.wijayasetmessageid: <1300746400.2.0.784325885279.issue11627@psf.upfronthosting.co.za>
2011-03-21 22:26:39santoso.wijayalinkissue11627 messages
2011-03-21 22:26:39santoso.wijayacreate