Closed GoogleCodeExporter closed 8 years ago
thanks! sorry I haven't fixed any of your issues yet, I'm sure I will get to
this this weekend. I spent yesterday testing a new example (a 1,000+ sloccount
ray tracer), and it took a bit longer than I expected.. it works nicely now
though.but back to this issue :)
I guess we could support only element 0, but please note that you can get the
error number and message also via 'e.errno' and 'e.strerror'.. since it's so
easy to work around this, there is a relatively clear error message, and using
indexing is rather ugly anyway, I don't think we really want to support
indexing here.
I added the following to the test set, because errno and strerror apparently
also don't work yet as expected:
try :
print("Try block")
fd = open("nosuchfile") # open will fail
print("File opened")
except IOError as e:
print e, repr(e)
print e.errno, e.strerror
Original comment by mark.duf...@gmail.com
on 11 Nov 2010 at 3:44
That should work, once implemented. Using fields of error types makes more
sense than subscripting them, and CPython already supports that.
Original comment by na...@animats.com
on 11 Nov 2010 at 6:04
done! there's some ugly duplication between OSError and IOError now, so I added
that to the easy task page. thanks!
Original comment by mark.duf...@gmail.com
on 13 Nov 2010 at 12:20
Original issue reported on code.google.com by
na...@animats.com
on 10 Nov 2010 at 7:57Attachments: