Permalink
Browse files

Safer loading of default config inside Python 3 config.

  • Loading branch information...
1 parent 326f739 commit 6c940b74d142b3c629c4c65429aec0016a4d480f @takluyver committed Aug 14, 2011
Showing with 11 additions and 3 deletions.
  1. +11 −3 IPython/config/profile/python3/ipython_config.py
@@ -1,3 +1,11 @@
-# This can be used at any point in a config file to load a sub config
-# and merge it into the current one.
-load_subconfig('ipython_config.py', profile='default')
+c = get_config()
+
+# If the master config file uses syntax that's invalid in Python 3, we'll skip
+# it and just use the factory defaults.
+try:
+ load_subconfig('ipython_config.py', profile='default')
+except Exception:
+ pass
+else:
+ # We reset exec_lines in case they're not compatible with Python 3.
+ c.InteractiveShellApp.exec_lines = []

0 comments on commit 6c940b7

Please sign in to comment.