diff --git a/IPython/zmq/tests/test_embed_kernel.py b/IPython/zmq/tests/test_embed_kernel.py index 8966777..ac5739e 100644 --- a/IPython/zmq/tests/test_embed_kernel.py +++ b/IPython/zmq/tests/test_embed_kernel.py @@ -36,8 +36,9 @@ def setup(): global save_get_ipython_dir IPYTHONDIR = tempfile.mkdtemp() - env = dict(IPYTHONDIR=IPYTHONDIR, - PYTHONPATH=os.environ['PYTHONPATH']) + env = dict(IPYTHONDIR=IPYTHONDIR) + if 'PYTHONPATH' in os.environ: + env['PYTHONPATH'] = os.environ['PYTHONPATH'] save_get_ipython_dir = path.get_ipython_dir path.get_ipython_dir = lambda : IPYTHONDIR