diff --git a/lib/matplotlib/iruby.rb b/lib/matplotlib/iruby.rb index 904989f..4c21b85 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 @@ -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