def rename(source, target): try: _rename(source, target) except OSError, e: if e.errno == errno.EXDEV: shutil.move(source, target) else: raise
def rename(source, target): try: _rename(source, target) except OSError: e = extract_exception() if e.errno == errno.EXDEV: shutil.move(source, target) else: raise