~kernevil/ubuntu/saucy/pylons/fix-useless-import

« back to all changes in this revision

Viewing changes to debian/patches/ipython_0.11_compatibility.patch

  • Committer: Bazaar Package Importer
  • Author(s): Piotr Ożarowski
  • Date: 2011-08-02 21:17:36 UTC
  • mfrom: (1.2.3 upstream) (10.1.3 experimental)
  • Revision ID: james.westby@ubuntu.com-20110802211736-ejqil9b3yqgxt6lr
Tags: 1.0-2
* Add ipython_0.11_compatibility patch (thanks to Julian Taylor)
* Add build-arch and build-indep targets to debian/rules 
* Switch from dh_pysupport to dh_python2
* Source format changed to 3.0 (quilt)
* Standards-Version bumped to 3.9.2 (no changes needed)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Index: pylons-0.10/pylons/commands.py
 
2
===================================================================
 
3
--- pylons-0.10.orig/pylons/commands.py 2011-07-24 15:28:25.708719706 +0200
 
4
+++ pylons-0.10/pylons/commands.py      2011-07-24 15:28:31.848719709 +0200
 
5
@@ -514,10 +514,14 @@
 
6
                 raise ImportError()
 
7
 
 
8
             # try to use IPython if possible
 
9
-            from IPython.Shell import IPShellEmbed
 
10
+            try:
 
11
+                from IPython.frontend.terminal.embed import InteractiveShellEmbed
 
12
+                shell = InteractiveShellEmbed(banner2=banner)
 
13
+            except ImportError:
 
14
+                from IPython.Shell import IPShellEmbed
 
15
+                shell = IPShellEmbed(argv=self.args)
 
16
+                shell.set_banner(shell.IP.BANNER + '\n\n' + banner)
 
17
 
 
18
-            shell = IPShellEmbed(argv=self.args)
 
19
-            shell.set_banner(shell.IP.BANNER + '\n\n' + banner)
 
20
             try:
 
21
                 shell(local_ns=locs, global_ns={})
 
22
             finally: