diff options
Diffstat (limited to 'python/pyspark/shell.py')
-rw-r--r-- | python/pyspark/shell.py | 4 |
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) |