%PDF- %PDF-
Direktori : /lib/python3/dist-packages/zope/interface/__pycache__/ |
Current File : //lib/python3/dist-packages/zope/interface/__pycache__/_compat.cpython-312.pyc |
� ��e � �P � d Z ddlZddlZd� Z eed� Zd� Zd� Zd� Zd� Z d d �Z y)z� Support functions for dealing with differences in platforms, including Python versions and implementations. This file should have no imports from the rest of zope.interface because it is used during early bootstrapping. � Nc �t � t | t � rt | d� } t | t � r| S t d� �)N�asciiz)name must be a string or ASCII-only bytes)� isinstance�bytes�str� TypeError)�names �8/usr/lib/python3/dist-packages/zope/interface/_compat.py�_normalize_namer s3 � ��$����4��!���$����� �?� @�@� �pypy_version_infoc �N � t j j d� } | dk( }|S )z� Return a true value if the C optimizations are required. This uses the ``PURE_PYTHON`` variable as documented in `_use_c_impl`. �PURE_PYTHON�0��os�environ�get)�pure_env� require_cs r �_c_optimizations_requiredr # s% � � �z�z�~�~�m�,�H��C��I��r c �P � t � rdnt f} ddlm} |S # | $ r Y yw xY w)z� Return the C optimization module, if available, otherwise a false value. If the optimizations are required but not available, this raises the ImportError. This does not say whether they should be used or not. � r )�_zope_interface_coptimizationsF)r �ImportError�zope.interfacer )�catch�c_opts r �_c_optimizations_availabler . s1 � � ,�-�B�K�>�E��J����� ���s � �%�%c �V � t j j d� } | duxr | dk7 S )z6 The opposite of `_c_optimizations_required`. r Nr r )r s r �_c_optimizations_ignoredr! @ s* � � �z�z�~�~�m�,�H��4��3�H��O�3r c �T � t t d� } t � ry| ryt � S )z� Return a true value if we should attempt to use the C optimizations. This takes into account whether we're on PyPy and the value of the ``PURE_PYTHON`` environment variable, as defined in `_use_c_impl`. r TF)�hasattr�sysr r! )�is_pypys r �_should_attempt_c_optimizationsr&