old_contents: import pathlib
  
  # path: pathlib.Path - directory to remove contents of
  def removeContents(path):
    for i in path.glob('*'):
      if i.is_dir():
        # NOTE: can replace both lines with `removeDirectory(i)` from pathlib-recusive-rmdir scrap
        removeContents(i)
        i.rmdir()
      else:
        i.unlink()
  
new_contents: import pathlib
  
  # path: pathlib.Path - directory to remove contents of
  def deleteContents(path):
    for i in path.glob('*'):
      if i.is_dir():
        # NOTE: can replace two lines below with `deleteDirectory(i)` from pathlib-recusive-delete-directory scrap
        deleteContents(i)
        i.rmdir()
      else:
        i.unlink()
  
subject: Update pathlib-recusive-delete-contents.py