You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@toree.apache.org by lr...@apache.org on 2017/02/19 09:36:58 UTC
[02/14] incubator-toree git commit: Make sure there is always a cell
to write to for the python interpreter
Make sure there is always a cell to write to for the python interpreter
Project: http://git-wip-us.apache.org/repos/asf/incubator-toree/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-toree/commit/447f0e24
Tree: http://git-wip-us.apache.org/repos/asf/incubator-toree/tree/447f0e24
Diff: http://git-wip-us.apache.org/repos/asf/incubator-toree/diff/447f0e24
Branch: refs/heads/sandbox
Commit: 447f0e24a4037ed9bc8a0838d60bdb1bd7678562
Parents: e1dc4e5
Author: David Taieb <da...@us.ibm.com>
Authored: Wed Jan 4 18:17:36 2017 -0500
Committer: David Taieb <da...@us.ibm.com>
Committed: Wed Jan 4 18:17:36 2017 -0500
----------------------------------------------------------------------
.../src/main/resources/PySpark/pyspark_runner.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-toree/blob/447f0e24/pyspark-interpreter/src/main/resources/PySpark/pyspark_runner.py
----------------------------------------------------------------------
diff --git a/pyspark-interpreter/src/main/resources/PySpark/pyspark_runner.py b/pyspark-interpreter/src/main/resources/PySpark/pyspark_runner.py
index fcb1a06..04d1666 100644
--- a/pyspark-interpreter/src/main/resources/PySpark/pyspark_runner.py
+++ b/pyspark-interpreter/src/main/resources/PySpark/pyspark_runner.py
@@ -151,12 +151,14 @@ kernel = Kernel(bridge.kernel())
while True:
try:
- code_info = state.nextCode()
+ next_code_info = state.nextCode()
# If code is not available, try again later
- if code_info is None:
+ if next_code_info is None:
sleep(1)
continue
+
+ code_info = next_code_info
code_lines = code_info.code().split("\n")
final_code = None