Skip to content

Commit

Permalink
fix generator issue
Browse files Browse the repository at this point in the history
  • Loading branch information
megatron-me-uk committed Jun 24, 2015
1 parent 8a9ef9c commit a0c0161
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 @@ -711,9 +711,10 @@ def check_return_code():
raise Exception("Pipe function `%s' exited "
"with error code %d" % (command, pipe.returncode))
else:
yield None
for i in range(0):
yield i
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''), check_return_code()))
return self.mapPartitions(func)

def foreach(self, f):
Expand Down

0 comments on commit a0c0161

Please sign in to comment.