From 388e1cd4e50059267b794808be0b2988edbc2a26 Mon Sep 17 00:00:00 2001 From: zheng-yongping Date: Mon, 16 Sep 2019 08:32:38 +0800 Subject: [PATCH 1/2] fix: issue #9 undefined method `error_message' --- lib/matplotlib/iruby.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/iruby.rb b/lib/matplotlib/iruby.rb index 904989f..34ce7ee 100644 --- a/lib/matplotlib/iruby.rb +++ b/lib/matplotlib/iruby.rb @@ -61,7 +61,7 @@ def execute_request(msg) rescue SystemExit content[:payload] << { source: :ask_exit } rescue Exception => e - content = error_message(e) + content = error_content(e) @session.send(:publish, :error, content) end From 33776299eabc425d37621f8a18895343d451b063 Mon Sep 17 00:00:00 2001 From: zheng-yongping Date: Mon, 16 Sep 2019 08:42:19 +0800 Subject: [PATCH 2/2] fix: gcf.get_all_fig_managers is never nil https://github.com/matplotlib/matplotlib/blob/9299bccd4eef00af574fb8f9bc7d7c7cdc65d888/lib/matplotlib/_pylab_helpers.py#L90 --- lib/matplotlib/iruby.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/iruby.rb b/lib/matplotlib/iruby.rb index 34ce7ee..4c21b85 100644 --- a/lib/matplotlib/iruby.rb +++ b/lib/matplotlib/iruby.rb @@ -248,7 +248,7 @@ def show_figures(close=false) execution_count: kernel.instance_variable_get(:@execution_count)) end ensure - unless gcf.get_all_fig_managers.nil? + unless gcf.get_all_fig_managers.length == 0 Matplotlib::Pyplot.close('all') end end