Commits

Thomas Waldmann committed 417021b Merge

merged

Comments (0)

Files changed (1)

MoinMoin/script/maint/moinshell.py

 # -*- coding: utf-8 -*-
 
+import code
+
 from flask import Flask, _request_ctx_stack
 from flask import current_app as app
 from flask import g as flaskg
                 sh = IPython.Shell.IPShellEmbed(banner=self.banner)
                 sh(global_ns=dict(), local_ns=context)
                 return
-            except ImportError:
+            except AttributeError:
                 # IPython = 0.11
                 import IPython
                 sh = IPython.embed(banner2=self.banner, user_ns=context)
-                sh()
-            finally:
+                return
+            except ImportError:
                 pass
 
         code.interact(self.banner, local=context)