From ac602155649b29ed1a4545dd62089f10733b6f68 Mon Sep 17 00:00:00 2001 From: noah-weingarden Date: Fri, 8 Nov 2024 03:20:42 -0500 Subject: [PATCH] Add more OSError handling --- madoop/mapreduce.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/madoop/mapreduce.py b/madoop/mapreduce.py index 3d2c660..e12958f 100644 --- a/madoop/mapreduce.py +++ b/madoop/mapreduce.py @@ -199,7 +199,7 @@ def map_single_chunk(exe, input_path, output_path, chunk): input=chunk, stdout=outfile, ) - except subprocess.CalledProcessError as err: + except (subprocess.CalledProcessError, OSError) as err: raise MadoopError( f"Command returned non-zero: " f"{exe} < {input_path} > {output_path}" @@ -420,7 +420,7 @@ def reduce_single_file(exe, input_path, output_path): stdin=infile, stdout=outfile, ) - except subprocess.CalledProcessError as err: + except (subprocess.CalledProcessError, OSError) as err: raise MadoopError( f"Command returned non-zero: " f"{exe} < {input_path} > {output_path}"