aboutsummaryrefslogtreecommitdiff
path: root/pyspark
diff options
context:
space:
mode:
authorNick Pentreath <nick.pentreath@gmail.com>2013-12-15 09:39:45 +0200
committerNick Pentreath <nick.pentreath@gmail.com>2013-12-15 09:39:45 +0200
commitbb5277b10a3797c1beeca01c32b287ee79db831d (patch)
tree4c42b95893ad6bd543729ac6ed0db056dabd586b /pyspark
parentd36ee3b159dff04b3a3222d6c55ee27ba93cd074 (diff)
downloadspark-bb5277b10a3797c1beeca01c32b287ee79db831d.tar.gz
spark-bb5277b10a3797c1beeca01c32b287ee79db831d.tar.bz2
spark-bb5277b10a3797c1beeca01c32b287ee79db831d.zip
Making IPython PySpark compatible across versions <1.0.0. Also cleaned up '-i' option and made IPYTHON_OPTS work
Diffstat (limited to 'pyspark')
-rwxr-xr-xpyspark7
1 files changed, 6 insertions, 1 deletions
diff --git a/pyspark b/pyspark
index 8b34c98578..12cc926dda 100755
--- a/pyspark
+++ b/pyspark
@@ -59,7 +59,12 @@ if [ -n "$IPYTHON_OPTS" ]; then
fi
if [[ "$IPYTHON" = "1" ]] ; then
- exec ipython "$IPYTHON_OPTS" "$@"
+ # IPython <1.0.0 doesn't honor PYTHONSTARTUP, while 1.0.0+ does.
+ # Hence we clear PYTHONSTARTUP and use the -c "%run $IPYTHONSTARTUP" command which works on all versions
+ # We also force interactive mode with "-i"
+ IPYTHONSTARTUP=$PYTHONSTARTUP
+ PYTHONSTARTUP=
+ exec ipython "$IPYTHON_OPTS" -i -c "%run $IPYTHONSTARTUP"
else
exec "$PYSPARK_PYTHON" "$@"
fi