From 9efd934b7d8d7fd3e9a3b72a57d7ed5dfe17d377 Mon Sep 17 00:00:00 2001 From: Rongxin Liu Date: Mon, 4 Oct 2021 03:15:21 -0400 Subject: [PATCH] raise FileNotFoundError in addition to IsADirectoryError in _copy --- check50/_api.py | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/check50/_api.py b/check50/_api.py index f655b1b3..7b0b1ec6 100644 --- a/check50/_api.py +++ b/check50/_api.py @@ -515,7 +515,7 @@ def _copy(src, dst): """Copy src to dst, copying recursively if src is a directory.""" try: shutil.copy(src, dst) - except IsADirectoryError: + except (FileNotFoundError, IsADirectoryError): if os.path.isdir(dst): dst = os.path.join(dst, os.path.basename(src)) shutil.copytree(src, dst) diff --git a/setup.py b/setup.py index 5ab7b2bf..8fe62333 100644 --- a/setup.py +++ b/setup.py @@ -29,6 +29,6 @@ "console_scripts": ["check50=check50.__main__:main"] }, url="https://github.com/cs50/check50", - version="3.3.3", + version="3.3.4", include_package_data=True )