aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2021-09-27 05:13:19 +0300
committerFrederick Muriuki Muriithi2021-09-27 05:13:19 +0300
commit60d54d8de466c179a93b6d46ad05ec1b9ba5f4a1 (patch)
treeca608d1302fc1e605ebc7f27535ba74398a7f5e0
parent1d09a9222f8c661da3abd6d61c09ae19eeb5d793 (diff)
downloadgenenetwork3-60d54d8de466c179a93b6d46ad05ec1b9ba5f4a1.tar.gz
Narrow the exception and add comments
Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/clustering.gmi * Only catch the `FileExistsError` allowing any other exception to pass through. This tries to conform a little to the review at https://github.com/genenetwork/genenetwork3/pull/37#discussion_r714552696
-rw-r--r--gn3/computations/qtlreaper.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/gn3/computations/qtlreaper.py b/gn3/computations/qtlreaper.py
index 166d2dd..d1ff4ac 100644
--- a/gn3/computations/qtlreaper.py
+++ b/gn3/computations/qtlreaper.py
@@ -34,7 +34,8 @@ def create_output_directory(path: str):
"""Create the output directory at `path` if it does not exist."""
try:
os.mkdir(path)
- except OSError:
+ except FileExistsError:
+ # If the directory already exists, do nothing.
pass
def run_reaper(