def really_rename(source,target):
    """Like os.rename, but try to work around some win32 wierdness.

    Every so often windows likes to throw a spurious error about not being
    able to rename something; if we sleep for a brief period and try
    again it seems to get over it.
    """
    if sys.platform != "win32":
        os.rename(source,target)
    else:
        for _ in xrange(100):
            try:
                os.rename(source,target)
            except WindowsError, e:
                if e.errno not in (errno.EACCES,):
                    raise
                time.sleep(0.01)
            else:
                break
        else:
            os.rename(source,target)
dataset/ETHPy150Open cloudmatrix/esky/esky/util.py/really_rename/original