
    Ef                     L   d Z ddlZddlZddlmZ d Z e        ed        Z e       5  ddlmZ ddd       ddl	m
Z
 dd	l
 dd	l dd
lmZ dd	l d Zd ZdZ ej"                  d      Zg de
j&                  z   ej&                  z   ej&                  z   Zy# 1 sw Y   jxY w)zPython bindings for 0MQ.    N)contextmanagerc                     ddl } t        t        d      }| j                         j	                         dk(  }|rddl}t        j                         }|j                  |z  }|t        t        dd       z  }|r<t        j                   dk(  r)|t        t        dd	      z  }|t        t        d
d       z  }t        j                  |       	 d	dlm} |t               d<   |r+ddl}|j                  |j                  |j                         	 |rt        j                         yy# t         $ r ddlm}  |dd      r Y 4w xY w# |rt        j                         w w xY w)z#load bundled libzmq if there is oner   Ngetdlopenflagspypy
RTLD_LOCAL   darwin	RTLD_LAZY   RTLD_NOW   )libzmq_libzmq)	find_specz.libzmqzmq)platformhasattrsyspython_implementationlowerctypesr   RTLD_GLOBALgetattrossetdlopenflags r   globalsCDLL__file__ImportErrorimportlib.utilr   )r   dlopenPYPYr   dlflagsflagsr   r   s           ./usr/lib/python3/dist-packages/zmq/__init__.py_load_libzmqr'      s<   S*+F ))+113v=D$$&""W,'"lA...CLLH,WRa00Egb*a000E5!(  &	)
 KK););<w' )  ,Y&  '	( w' s*   D! :E  !D=:E  <D==E   Ec               #     K   t         j                  j                  d      sd yt        j                  j                  t        j                  j                  t        j                  j                  t              t        j                  d            } t        j                  j                  |       sd yt        j                  j                  d      }	 t        j                  j                  |xs d| g      t        j                  d<   d | t        j                  j                  d       y|t        j                  d<   y# | t        j                  j                  d       w |t        j                  d<   w xY ww)zcontext manager for libs directory on $PATH

    Works around mysterious issue where os.add_dll_directory
    does not resolve imports (conda-forge Python >= 3.8)
    winNz
pyzmq.libsPATHr   )r   r   
startswithr   pathabspathjoindirnamer   pardirexistsenvirongetpathseppop)libs_dirpath_befores     r&   _libs_on_pathr8   @   s      <<""5)ww
GGOOH%II	
H 77>>(#**..(K-ZZ__k.?R-JK

6JJNN6"!,BJJv JJNN6"!,BJJvs   CF:E 6F7E??F)backendr   )	constants)*)sugarc            	          ddl m} m}m}m}m}  |t              } |  |||            }|gdD cg c]  } ||||       c}z   } | |||d            r|j                   |||d             |S c c}w )zNReturn a list of directories to include for linking against pyzmq with cython.r   )r-   r/   r1   r.   r0   )utilsinclude)os.pathr-   r/   r1   r.   r0   r   append)	r-   r/   r1   r.   r0   baseparentsubdirincludess	            r&   get_includesrF   p   st    >>8DT$'(FxJO&4f5OOHd64+,VT956O Ps   A1c                  d    ddl m} m}m}m}  |t
              } |  |||            } |||      gS )zIReturn a list of directories used to link against pyzmq's bundled libzmq.r   )r-   r/   r.   r0   )r@   r-   r/   r.   r0   r   )r-   r/   r.   r0   rB   rC   s         r&   get_library_dirsrH   |   s3    668DT$'(F    i   draft)rF   COPY_THRESHOLD	DRAFT_API)__doc__r   r   
contextlibr   r'   r8   r   r9   r   r:   zmq.backendr<   	zmq.sugarrF   rH   rK   hasrL   __all__ rI   r&   <module>rT      s     
 
 %-(`  - -J _      	  GKK 	
  mm oo E s   BB#