Skip to content

Commit

Permalink
style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
megatron-me-uk committed Jun 19, 2015
1 parent 8ed89a6 commit 0486ae3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions python/pyspark/rdd.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 0486ae3

Please sign in to comment.