cy99 / shedskin

Automatically exported from code.google.com/p/shedskin
0 stars 0 forks source link

Reorder exceptions + add 2 new ones #38

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This 2 patches add 2 new exeptions (ImportError and AttributeError), so
some more programs can be compiled...

Furthermore, while typing them in, I notice that currently e.g.
EOFException is declared twice in lib/builtin.py

With reordered according to alphabeth, that would not happened…
(-> Second patch)

What version of the product are you using? On what operating system?
trunk

Original issue reported on code.google.com by thomas.s...@gmail.com on 23 Aug 2009 at 5:13

Attachments:

GoogleCodeExporter commented 9 years ago
thanks for cleaning up! I committed everything, except for the addition of
AttributeError and ImportError. the reasoning is similar to the comment I gave 
on
your import patch: we can support these partially, but never completely (as in
Python), so it seems better not to support them at all. an example:

try:
    import psyco
    psyco.full()
except ImportError:
    pass

we could check for the ImportError at compile-time, but what if it says 'except
Exception'? this typically leads to a series of hacks, after which the feature 
is
dropped in the end.. :)

similarly, in C++ an AttributeError just cannot occur, so it can never be 
supported
fully..

Original comment by mark.duf...@gmail.com on 24 Aug 2009 at 3:26