# HG changeset patch # User Patrick Mezard # Date 2008-10-18 18:50:08 # Node ID 0c63b87d9bceb608d67d6395b854e45cf01e69eb # Parent d834ed27199f22271f505bf42920cdb41243159d util: handle EINVAL in _statfiles_clustered() Raised when osutil.listdir is called on a non-directory entry. diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -865,7 +865,9 @@ def _statfiles_clustered(files): # 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)