P
Paddy
Bruno said:And this would be still more informative (and not deprecated...):
filename = '/tmp/foo'
f = open(fliename)
Catching an exception just to raise a less informative one is somewhat
useless IMHO.
Except that in the 'artificial' environment of homework, you are marked
for what you *show* you know, Catching an exception shows that the
pupil considered that opening a file could throw an exception.
You would have to comment that a try except block was considered, give
an example of correct usage, then why it was not used, to get
equivalent, (or slightly higher), marks.
(That was drilled into me so many times at school).
- Paddy.