Mercurial > public > mercurial-scm > hg
comparison mercurial/util.py @ 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 | 716277f5867e |
children | 1be530a3180e |
comparison
equal
deleted
inserted
replaced
7136:d834ed27199f | 7137:0c63b87d9bce |
---|---|
863 for n, k, s in osutil.listdir(dir, True)]) | 863 for n, k, s in osutil.listdir(dir, True)]) |
864 except OSError, err: | 864 except OSError, err: |
865 # handle directory not found in Python version prior to 2.5 | 865 # handle directory not found in Python version prior to 2.5 |
866 # Python <= 2.4 returns native Windows code 3 in errno | 866 # Python <= 2.4 returns native Windows code 3 in errno |
867 # Python >= 2.5 returns ENOENT and adds winerror field | 867 # Python >= 2.5 returns ENOENT and adds winerror field |
868 if err.errno not in (3, errno.ENOENT, errno.ENOTDIR): | 868 # EINVAL is raised if dir is not a directory. |
869 if err.errno not in (3, errno.ENOENT, errno.EINVAL, | |
870 errno.ENOTDIR): | |
869 raise | 871 raise |
870 dmap = {} | 872 dmap = {} |
871 cache = dircache.setdefault(dir, dmap) | 873 cache = dircache.setdefault(dir, dmap) |
872 yield cache.get(base, None) | 874 yield cache.get(base, None) |
873 | 875 |