� c��j� � �D � d Z ddlZddlZd d�Zd� Zd� Zd� Zd� Zd� Zd � Z y)zShared AIX support functions.� Nc �. � ddl }ddl}t d|j � ��d� }|j |� 5 }|r| �d|j �d�}n| �d|j �d�}|j |� s|j � ndcddd� S # 1 sw Y yxY w) z0Output from successful command execution or Noner Nz/tmp/_aix_support.zw+bz >'z' 2>&1z 2>/dev/null >'�')�os� contextlib�open�getpid�closing�name�system�read)� commandstring�capture_stderrr r �fp�cmds �%/usr/lib64/python3.12/_aix_support.py�_read_cmd_outputr sw � � �� � � � ���� �B� � � �B� �2��%2�B�G�G�<�C�,9�2�7�7�C�C� "� � �#��r�w�w�y�D� � � �s �A B�Bc �~ � t j dk( rdnd}|dk7 r|nd}dj | d | d | d ||� S ) Ni���� �@ r �' zaix-{:1x}{:1d}{:02d}-{:04d}-{}� � )�sys�maxsize�format)�vrtl�bd�_sz�_bds r �_aix_tagr sI � � ����(�"�b�C��a��"�T�C�+�2�2�4��7�D��G�T�!�W�c�SV�W�W� c �x � | j d� d d \ }}}t |d � t |� t |� gS )N�.� �����)�split�int)�vrmf�v�r�tls r � _aix_vrtlr, $ s9 � ��z�z�#��r��"�H�A�q�"���"��J��A���B��(�(r! c � � ddl } | j g d�� }|j d� }|j � j d� }|d dk7 rt |d � nd }t |d � |fS # t $ r t d� }Y �nw xY w)a( Return a Tuple[str, int] e.g., ['7.1.4.34', 1806] The fileset bos.rte represents the current AIX run-time level. It's VRMF and builddate reflect the current ABI levels of the runtime environment. If no builddate is found give a value that will satisfy pep425 related queries r N)z/usr/bin/lslppz-Lqczbos.rtez/usr/bin/lslpp -Lqc bos.rtezutf-8�:r% � r r ) � subprocess�check_output�ImportErrorr �decode�stripr&