Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Safer loading of default config inside Python 3 config.

  • Loading branch information...
commit 6c940b74d142b3c629c4c65429aec0016a4d480f 1 parent 326f739
@takluyver authored
Showing with 11 additions and 3 deletions.
  1. +11 −3 IPython/config/profile/python3/ipython_config.py
View
14 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 = []
Please sign in to comment.
Something went wrong with that request. Please try again.