관리-도구
편집 파일: threadexception.cpython-311.pyc
� �܋fc � �x � d dl Z d dlZd dlZd dlmZ d dlmZ d dlmZ d dlmZ d dlm Z d dlm Z d dlZ G d� d � � Zd ed fd�Z ej d d �� � d ed fd�� � Z ej d d �� � d ed fd�� � Z ej d d �� � d ed fd�� � ZdS )� N)� TracebackType)�Any)�Callable)� Generator)�Optional)�Typec �r � e Zd ZdZd d�Zdd�Zdd�Zd eee d ee dee ddfd�ZdS )�catch_threading_exceptiona� Context manager catching threading.Thread exception using threading.excepthook. Storing exc_value using a custom hook can create a reference cycle. The reference cycle is broken explicitly when the context manager exits. Storing thread using a custom hook can resurrect it if it is set to an object which is being finalized. Exiting the context manager clears the stored object. Usage: with threading_helper.catch_threading_exception() as cm: # code spawning a thread which raises an exception ... # check the thread exception: use cm.args ... # cm.args attribute no longer exists at this point # (to break a reference cycle) �returnNc �"