
May 16, 2008
4:58 p.m.
On Fri, May 16, 2008 at 10:52 AM, Yannick Gingras <ygingras@ygingras.net> wrote:
"Alexander Belopolsky" <alexander.belopolsky@gmail.com> writes:
try: ... open('/') ... except Exception,e: ... pass ... 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.
Then, check out EnvironmentError_str in Objects/exceptions.c. You should be able import the errno module and fetch its errorcode dictionary. -- Alexandre