o
    1 i                     @   s   d dl Z d dlZd dlmZmZ er	 d dlZd dlmZ	 d dl
Zd dlmZ d dlmZ eeZeddZdedefd	d
ZdS )    N)TYPE_CHECKINGAny)ray_constants)inspect_serializabilityZ.RAY_allow_out_of_band_object_ref_serializationTobj	error_msgc              
   C   st   zt | W S  ttjjfy9 } z#t }t| |d | d|	  }t
|tr/t||tj|d}~ww )zdWrap cloudpickle.dumps to provide better error message
    when the object is not serializable.
    )Z
print_filez:
N)pickledumps	TypeErrorray
exceptionsZ(OufOfBandObjectRefSerializationExceptionioStringIOr   getvalue
isinstance)r   r   esiomsg r   e/home/app/PaddleOCR-VL-test/.venv_paddleocr/lib/python3.10/site-packages/ray/_common/serialization.pypickle_dumps   s   

r   )r   loggingtypingr   r   Zray._private.utilsr   Zray.cloudpickleZcloudpickler   Zray.exceptionsZray._privater   Zray.utilr   	getLogger__name__loggerZenv_boolZ*ALLOW_OUT_OF_BAND_OBJECT_REF_SERIALIZATIONstrr   r   r   r   r   <module>   s    
