* Jasper Groenewegen <[EMAIL PROTECTED]> wrote:
> Fix: Test for broken symlink error code and continue on
> encounter, e.g. not adding the file to the filelist.
> except OSError, e:
> if e.errno == 40:
> continue
> + elif e.errno == 2:
> + continue
> else:
> raise
Although the error codes are unlikely to change, wouldn't it be
safer and clearer to use the symbolic names instead? Also, I'd
be inclined to to put the acceptable error codes in a list and
check with "in"... for example:
except OSError, e:
if e.errno in (errno.ENOENT, errno.ELOOP):
continue
else:
raise
I see the same code gets run several times, too. Perhaps the
errors could be defined once and then reused?
acceptable_errors = (errno.ENOENT, errno.ELOOP)
...
if e.errno in acceptable_errors:
continue
Just a thought.
-- Scott
--
bzr-gtk mailing list
[email protected]
Modify settings or unsubscribe at:
https://lists.canonical.com/mailman/listinfo/bzr-gtk