From 0486ae33a5b7117c471312b35521d32ca8c9b1aa Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Fri, 19 Jun 2015 10:27:43 +0100 Subject: [PATCH] style fixes --- python/pyspark/rdd.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python/pyspark/rdd.py b/python/pyspark/rdd.py index 45575f14fa798..3093de75a8fef 100644 --- a/python/pyspark/rdd.py +++ b/python/pyspark/rdd.py @@ -704,15 +704,16 @@ def pipe_objs(out): out.write(s.encode('utf-8')) out.close() Thread(target=pipe_objs, args=[pipe.stdin]).start() + def check_return_code(): pipe.wait() if pipe.returncode: raise Exception("Pipe function `%s' exited " - "with error code %d" % (command, pipe.returncode)) + "with error code %d" % (command, pipe.returncode)) else: return None return (x.rstrip(b'\n').decode('utf-8') for x in - chain(iter(pipe.stdout.readline, b''), iter(check_return_code, None))) + chain(iter(pipe.stdout.readline, b''), iter(check_return_code, None))) return self.mapPartitions(func) def foreach(self, f):