aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron LI <aaronly.me@outlook.com>2017-02-06 11:50:34 +0800
committerAaron LI <aaronly.me@outlook.com>2017-02-06 11:50:34 +0800
commit100c271015c52c5a7c8126f02f0b7e1a4ee483d8 (patch)
treec67425cedb8f6e1ec8af0ea65f6bcc988ecc9b98
parentfcfede96ee8789fe39bf9c97c707466caa62214a (diff)
downloadchandra-acis-analysis-100c271015c52c5a7c8126f02f0b7e1a4ee483d8.tar.bz2
setup_pfiles.py: Handle the SameFileError when copy pfiles
-rw-r--r--scripts/setup_pfiles.py5
1 files changed, 4 insertions, 1 deletions
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"]