o
    Zh                     @   sd   d dl mZ d dlZd dlmZ d dlmZ d dlmZ d dlm	Z	m
Z
 er,d dlmZ dd	 ZdS )
    wrapsN)get_current_span)TYPE_CHECKING)OP)loggerqualname_from_function)Anyc                    s   t   fdd}|S )z
    Decorator to add child spans for functions.

    This is the Python 2 compatible version of the decorator.
    Duplicated code from ``sentry_sdk.tracing_utils_python3.start_child_span_decorator``.

    See also ``sentry_sdk.tracing.trace()``.
    c                     sx   t tjj}|d u rtdt   | i |S |jtj	t d  | i |W  d    S 1 s5w   Y  d S )NzcCan not create a child span for %s. Please start a Sentry transaction before calling this function.)opdescription)
r   
sentry_sdkZHubcurrentr   warningr   Zstart_childr   ZFUNCTION)argskwargsspanfunc S/var/www/html/lang_env/lib/python3.10/site-packages/sentry_sdk/tracing_utils_py2.pyfunc_with_tracing   s   $z5start_child_span_decorator.<locals>.func_with_tracingr   )r   r   r   r   r   start_child_span_decorator   s   r   )	functoolsr   r   r   Zsentry_sdk._typesr   Zsentry_sdk.constsr   Zsentry_sdk.utilsr   r   typingr	   r   r   r   r   r   <module>   s    