Sha256: 1ee9d8a509a5e076b46692b9e1161332dab3299b4ca3ed7c4accf423d60bc029
Contents?: true
Size: 602 Bytes
Versions: 20
Compression:
Stored size: 602 Bytes
Contents
require 'pycall/error' module PyCall class PyError < Error def initialize(type, value, traceback) @type = type @value = value @traceback = traceback super("Exception occurred in Python") end attr_reader :type, :value, :traceback def to_s "#{type}: #{value}".tap do |msg| if (strs = format_traceback) msg << "\n" strs.each {|s| msg << s } end end end private def format_traceback return nil if traceback.nil? ::PyCall.import_module('traceback').format_tb(traceback) end end end
Version data entries
20 entries across 20 versions & 1 rubygems