diff options
Diffstat (limited to 'lib/spack/spack/cmd/python.py')
-rw-r--r-- | lib/spack/spack/cmd/python.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/spack/spack/cmd/python.py b/lib/spack/spack/cmd/python.py index 86b8c827f8..7bd2e45ce0 100644 --- a/lib/spack/spack/cmd/python.py +++ b/lib/spack/spack/cmd/python.py @@ -27,7 +27,6 @@ import sys import code from external import argparse import platform -from contextlib import closing import spack @@ -44,13 +43,13 @@ def python(parser, args): if "PYTHONSTARTUP" in os.environ: startup_file = os.environ["PYTHONSTARTUP"] if os.path.isfile(startup_file): - with closing(open(startup_file)) as startup: + with open(startup_file) as startup: console.runsource(startup.read(), startup_file, 'exec') python_args = args.python_args if python_args: sys.argv = python_args - with closing(open(python_args[0])) as file: + with open(python_args[0]) as file: console.runsource(file.read(), python_args[0], 'exec') else: console.interact("Spack version %s\nPython %s, %s %s""" |