Message131692
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! |
|
Date |
User |
Action |
Args |
2011-03-21 22:26:40 | santoso.wijaya | set | recipients:
+ santoso.wijaya, pitrou, michael.foord, Trundle |
2011-03-21 22:26:40 | santoso.wijaya | set | messageid: <1300746400.2.0.784325885279.issue11627@psf.upfronthosting.co.za> |
2011-03-21 22:26:39 | santoso.wijaya | link | issue11627 messages |
2011-03-21 22:26:39 | santoso.wijaya | create | |
|