~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/osutils.py

  • Committer: Henri Wiechers
  • Date: 2006-11-02 21:11:19 UTC
  • mto: (2131.1.1 jam-integration)
  • mto: This revision was merged to the branch mainline in revision 2133.
  • Revision ID: hwiechers@gmail.com-20061102211119-7017a1215fd5f2fa
Fixes osutils.rmtree on Windows with Python 2.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
332
332
        """Error handler for shutil.rmtree function [for win32]
333
333
        Helps to remove files and dirs marked as read-only.
334
334
        """
335
 
        type_, value = excinfo[:2]
 
335
        exception = excinfo[1]
336
336
        if function in (os.remove, os.rmdir) \
337
 
            and type_ == OSError \
338
 
            and value.errno == errno.EACCES:
 
337
            and isinstance(exception, OSError) \
 
338
            and exception.errno == errno.EACCES:
339
339
            make_writable(path)
340
340
            function(path)
341
341
        else: