From 100c271015c52c5a7c8126f02f0b7e1a4ee483d8 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Mon, 6 Feb 2017 11:50:34 +0800 Subject: setup_pfiles.py: Handle the SameFileError when copy pfiles --- scripts/setup_pfiles.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/setup_pfiles.py b/scripts/setup_pfiles.py index d927005..8a80a14 100644 --- a/scripts/setup_pfiles.py +++ b/scripts/setup_pfiles.py @@ -30,6 +30,9 @@ def setup_pfiles(tools): "paccess", tool ]).decode("utf-8").strip() subprocess.check_call(["punlearn", tool]) - shutil.copy(pfile, ".") + try: + shutil.copy(pfile, ".") + except shutil.SameFileError: + pass # Setup the ``PFILES`` environment variable os.environ["PFILES"] = "./:" + os.environ["PFILES"] -- cgit v1.2.2