← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-pkg/yade/git-trunk] Rev 3983: Fix yade with IPython5.

 

------------------------------------------------------------
revno: 3983
committer: Anton Gladky <gladk@xxxxxxxxxx>
timestamp: Sat 2016-12-10 21:21:52 +0100
message:
  Fix yade with IPython5.
modified:
  core/main/main.py.in


--
lp:yade
https://code.launchpad.net/~yade-pkg/yade/git-trunk

Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-pkg/yade/git-trunk/+edit-subscription
=== modified file 'core/main/main.py.in'
--- core/main/main.py.in	2015-08-28 19:31:57 +0000
+++ core/main/main.py.in	2016-12-10 20:21:52 +0000
@@ -228,9 +228,14 @@
 			from IPython.terminal.embed import InteractiveShellEmbed
 		else:
 			from IPython.frontend.terminal.embed import InteractiveShellEmbed
-		from IPython.config.loader import Config
-		cfg = Config()
-		prompt_config = cfg.PromptManager
+		if yade.runtime.ipython_version>=500:
+			from traitlets.config.loader import Config
+			cfg = Config()
+			prompt_config = cfg.TerminalInteractiveShell.prompts_class
+		else:
+			from IPython.config.loader import Config
+			cfg = Config()
+			prompt_config = cfg.PromptManager
 		prompt_config.in_template = ipconfig['prompt_in1']
 		prompt_config.in2_template = ipconfig['prompt_in2']
 		prompt_config.out_template = ipconfig['prompt_out']