1

I know that with Python 3.8 has been introduced 'dirs_exist_ok=True' argument but I am constrained on Python 3.7 I have tried with no success

shutil.copytree(homePath, dst, symlinks=False, ignore=None)

Is there a way to avoid the exception with 1 line of code?

federico
  • 27
  • 1
  • 4
  • 1
    No, I don't think that is possible. You would need to use the os module, for instance, to check if the path already exists before hand and if not copy it. – Cow Aug 19 '22 at 08:59

0 Answers0