~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree_4.py

Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
99
99
# This is the Windows equivalent of ENOTDIR
100
100
# It is defined in pywin32.winerror, but we don't want a strong dependency for
101
101
# just an error code.
 
102
ERROR_PATH_NOT_FOUND = 3
102
103
ERROR_DIRECTORY = 267
103
104
 
104
105
 
2082
2083
                    # python 2.5 has e.errno == EINVAL,
2083
2084
                    #            and e.winerror == ERROR_DIRECTORY
2084
2085
                    e_winerror = getattr(e, 'winerror', None)
 
2086
                    win_errors = (ERROR_DIRECTORY, ERROR_PATH_NOT_FOUND)
2085
2087
                    # there may be directories in the inventory even though
2086
2088
                    # this path is not a file on disk: so mark it as end of
2087
2089
                    # iterator
2088
2090
                    if e.errno in (errno.ENOENT, errno.ENOTDIR, errno.EINVAL):
2089
2091
                        current_dir_info = None
2090
2092
                    elif (sys.platform == 'win32'
2091
 
                          and ERROR_DIRECTORY in (e.errno, e_winerror)):
 
2093
                          and (e.errno in win_errors
 
2094
                               or e_winerror in win_errors)):
2092
2095
                        current_dir_info = None
2093
2096
                    else:
2094
2097
                        raise