changeset 7137:0c63b87d9bce

util: handle EINVAL in _statfiles_clustered() Raised when osutil.listdir is called on a non-directory entry.
author Patrick Mezard <pmezard@gmail.com>
date Sat, 18 Oct 2008 20:50:08 +0200
parents d834ed27199f
children beeeb0cd73e7
files mercurial/util.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/util.py	Sat Oct 18 11:43:45 2008 -0700
+++ b/mercurial/util.py	Sat Oct 18 20:50:08 2008 +0200
@@ -865,7 +865,9 @@
                 # handle directory not found in Python version prior to 2.5
                 # Python <= 2.4 returns native Windows code 3 in errno
                 # Python >= 2.5 returns ENOENT and adds winerror field
-                if err.errno not in (3, errno.ENOENT, errno.ENOTDIR):
+                # EINVAL is raised if dir is not a directory.
+                if err.errno not in (3, errno.ENOENT, errno.EINVAL,
+                                     errno.ENOTDIR):
                     raise
                 dmap = {}
             cache = dircache.setdefault(dir, dmap)