From 394eb7996c0e2d4d2fa69523fe913c8b9ecf91ed Mon Sep 17 00:00:00 2001 From: David Tomaschik Date: Wed, 27 Mar 2019 22:46:06 -0700 Subject: [PATCH] Conditionally start ipython. --- dotfiles/ipython.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/dotfiles/ipython.py b/dotfiles/ipython.py index f758bda..db5c9f4 100644 --- a/dotfiles/ipython.py +++ b/dotfiles/ipython.py @@ -1,4 +1,7 @@ -import os, IPython -os.environ['PYTHONSTARTUP'] = '' # Prevent running this again -IPython.start_ipython() -raise SystemExit +try: + import os, IPython + os.environ['PYTHONSTARTUP'] = '' # Prevent running this again + IPython.start_ipython() + raise SystemExit +except ImportError: + pass