sugar-base-0.90 (0.90.1-3) 1001_modernize_ipython_support.patch

Summary

 src/sugar/logger.py |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

    
download this patch

Patch contents

Description: add compatibility with ipython 0.11
 AutoFormattedTB now is in IPython.core.
 Both possibilities are tried to remain compatible with older
 ipython versions.
Author: Julian Taylor <jtaylor.debian@googlemail.com>

--- a/src/sugar/logger.py
+++ b/src/sugar/logger.py
@@ -70,7 +70,10 @@
     # Attempt to provide verbose IPython tracebacks.
     # Importing IPython is slow, so we import it lazily.
     try:
-        from IPython.ultraTB import AutoFormattedTB
+        try:
+            from IPython.core.ultratb import AutoFormattedTB
+        except ImportError:
+            from IPython.ultraTB import AutoFormattedTB
         sys.excepthook = AutoFormattedTB(mode='Verbose',
             color_scheme='NoColor')
     except ImportError: