
May 16, 2008
3:02 p.m.
On Fri, May 16, 2008 at 10:52 AM, Yannick Gingras <ygingras@ygingras.net> wrote:
print e [Errno 21] Is a directory
So now I am not sure what OP is proposing. Do you want to replace 21 with EISDIR in the above?
Yes, that's what I had in mind.
In this case, I have a more drastic proposal. Lets change EnvironmentError errno attribute (myerrno in C) to string. 'EXYZ' strings can be interned, which will make them more efficient than integers for lookups and comparisons (to literals). A half-way and backward compatible solution would be to stick 'EXYZ' code at the end of the args tuple and add an errnosym attribute.