mercurial/windows.py
changeset 44452 9d2b2df2c2ba
parent 43922 70abcb614a5c
child 44866 5258bffdb1d6
equal deleted inserted replaced
44449:ff72bd52d56a 44452:9d2b2df2c2ba
   533         if not dir:
   533         if not dir:
   534             dir = b'.'
   534             dir = b'.'
   535         cache = dircache.get(dir, None)
   535         cache = dircache.get(dir, None)
   536         if cache is None:
   536         if cache is None:
   537             try:
   537             try:
   538                 dmap = dict(
   538                 dmap = {
   539                     [
   539                     normcase(n): s
   540                         (normcase(n), s)
   540                     for n, k, s in listdir(dir, True)
   541                         for n, k, s in listdir(dir, True)
   541                     if getkind(s.st_mode) in _wantedkinds
   542                         if getkind(s.st_mode) in _wantedkinds
   542                 }
   543                     ]
       
   544                 )
       
   545             except OSError as err:
   543             except OSError as err:
   546                 # Python >= 2.5 returns ENOENT and adds winerror field
   544                 # Python >= 2.5 returns ENOENT and adds winerror field
   547                 # EINVAL is raised if dir is not a directory.
   545                 # EINVAL is raised if dir is not a directory.
   548                 if err.errno not in (errno.ENOENT, errno.EINVAL, errno.ENOTDIR):
   546                 if err.errno not in (errno.ENOENT, errno.EINVAL, errno.ENOTDIR):
   549                     raise
   547                     raise