From 681e926dcab4959b8aff3137de0a4ac6327a90b3 2012-05-26 04:25:47 From: Fernando Perez Date: 2012-05-26 04:25:47 Subject: [PATCH] Ensure pythonpath is applied to test env only if present. --- 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