Parse::StackTrace::Type::Python::Thread - A thread from a Python stack


Parse-StackTrace documentation Contained in the Parse-StackTrace distribution.

Index


Code Index:

NAME

Top

Parse::StackTrace::Type::Python::Thread - A thread from a Python stack trace.

DESCRIPTION

Top

This is an implementation of Parse::StackTrace::Thread for Python.

If the parsed stack trace has a line describing the exception that was thrown (like "Error: timed out"), then the description of this thread will contain that entire line.


Parse-StackTrace documentation Contained in the Parse-StackTrace distribution.

package Parse::StackTrace::Type::Python::Thread;
use Moose;

extends 'Parse::StackTrace::Thread';

sub add_frame {
    my $self = shift;
    $self->_unshift_frame(@_);
    my $count = 0;
    foreach my $frame (@{ $self->frames }) {
        $frame->{number} = $count;
        $count++;
    }
}

sub frame_number {
    return $_[0]->frames->[$_[1]];
}

sub frame_with_crash { return $_[0]->frame_number(0) };

__PACKAGE__->meta->make_immutable;

1;

__END__