~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/osutils.py

Merge from bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
549
549
            raise
550
550
        copyfile(src, dest)
551
551
 
 
552
def delete_any(full_path):
 
553
    """Delete a file or directory."""
 
554
    try:
 
555
        os.unlink(full_path)
 
556
    except OSError, e:
 
557
    # We may be renaming a dangling inventory id
 
558
        if e.errno not in (errno.EISDIR, errno.EACCES, errno.EPERM):
 
559
            raise
 
560
        os.rmdir(full_path)
 
561
 
552
562
 
553
563
def has_symlinks():
554
564
    if hasattr(os, 'symlink'):