def copytree_hardlink(source, dest):
 copy2 = shutil.copy2
 try:
  shutil.copy2 = os.link
  shutil.copytree(source, dest)
 finally:
  shutil.copy2 = copy2

def copytree_hardlink ( source , dest ) : copy2 = shutil . copy2 try : shutil . copy2 = os . link shutil . copytree ( source , dest ) finally : shutil . copy2 = copy2
recursively copy a directory ala shutils .