Mini Shell
3
��\L � @ s� d dl Z d dlZd dlZd dlZd dlZd dlmZ d dlmZ ye Z
W n ek
r` eZ
Y nX ye
ZW n ek
r� eZY nX G dd� de�ZG dd� de�ZdS )� N)�PackageInfo)�SafeStrc @ sn e Zd ZdZdd� Zedd� �Zdd� Zedd � �Zd
d� Z dd
� Z
ddd�Zdd� Zedd� �Z
dd� ZdS )�
ExceptionDumpz�This class represents a traceback and contains several useful methods
for manipulating a traceback. In general, clients should not have to
use this class. It is mainly for internal use.
c C sD t j|j�rt j|j�| _n|j| _|| _|j| _|j| _i | _dS )aN Create a new ExceptionDump instance. Instance attributes:
:param exc_info: info about the exception provided by Python
:type exc_info: an instance of the meh.ExceptionInfo class
:param config_obj: configuration for python-meh
:type config_obj: an instance of the meh.Config class
N)�inspectZistraceback�stackZgetinnerframes�conf�type�value� _dumpHash)�self�exc_infoZ
config_obj� r
�/usr/lib/python3.6/dump.py�__init__2 s zExceptionDump.__init__c C s, | j r$| jr$tj| j | j�d j� S dS d S )Nr � )r r � traceback�format_exception_only�strip)r r
r
r �descF s zExceptionDump.descc
s* d� G dd� dt ��dd� }tjd f�fdd� �� fd d
�}��fdd�}d
d� }y�� \}}W n �k
r~ d}d}Y nX dj|| ��}t� }tj� d |d<