commit:     9efd18b950963bbad2ffd061815ce27e220bd69d
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Jan 17 16:19:21 2023 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Jan 17 16:19:21 2023 +0000
URL:        https://gitweb.gentoo.org/proj/gentoopm.git/commit/?id=9efd18b9

Remove compat with old IPython

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 gentoopm/querycli.py | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)

diff --git a/gentoopm/querycli.py b/gentoopm/querycli.py
index 26f7154..ca7897f 100644
--- a/gentoopm/querycli.py
+++ b/gentoopm/querycli.py
@@ -226,17 +226,11 @@ class PMQueryCommands(object):
             try:
                 from IPython import embed
             except ImportError:
-                try:
-                    from IPython.Shell import IPShellEmbed
-                except ImportError:
-                    print("For better user experience, install IPython.")
-                    from code import InteractiveConsole
-
-                    embed = InteractiveConsole({"pm": pm}).interact
-                    kwargs["banner"] = welc
-                else:
-                    embed = IPShellEmbed()
-                    embed.set_banner(embed.IP.BANNER + "\n\n" + welc)
+                print("For better user experience, install IPython.")
+                from code import InteractiveConsole
+
+                embed = InteractiveConsole({"pm": pm}).interact
+                kwargs["banner"] = welc
             else:
                 kwargs["banner2"] = welc
 

Reply via email to