aboutsummaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/pyspark/shell.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/python/pyspark/shell.py b/python/pyspark/shell.py
index 99331297c1..26cafca8b8 100644
--- a/python/pyspark/shell.py
+++ b/python/pyspark/shell.py
@@ -76,4 +76,6 @@ if add_files is not None:
# which allows us to execute the user's PYTHONSTARTUP file:
_pythonstartup = os.environ.get('OLD_PYTHONSTARTUP')
if _pythonstartup and os.path.isfile(_pythonstartup):
- execfile(_pythonstartup)
+ with open(_pythonstartup) as f:
+ code = compile(f.read(), _pythonstartup, 'exec')
+ exec(code)