From 60d54d8de466c179a93b6d46ad05ec1b9ba5f4a1 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Mon, 27 Sep 2021 05:13:19 +0300 Subject: 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 --- gn3/computations/qtlreaper.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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( -- cgit v1.2.3