OwlCyberSecurity - MANAGER
Edit File: _osx_support.pyo
� zfc�����������@���s����d��Z��d�d�l�Z�d�d�l�Z�d�d�l�Z�d�d�d�d�g�Z�d$�Z�d%�Z�d�Z�d�d���Z �d����Z �d����Z�d�a�d����Z �d����Z�d����Z�d����Z�d����Z�d����Z�d����Z�d����Z�d����Z�d ����Z�d!����Z�d"����Z�d#����Z�d�S(&���s���Shared OS X support functions.i����Nt���compiler_fixupt���customize_config_varst���customize_compilert���get_platform_osxt���CFLAGSt���LDFLAGSt���CPPFLAGSt ���BASECFLAGSt ���BLDSHAREDt���LDSHAREDt���CCt���CXXt ���PY_CFLAGSt ���PY_LDFLAGSt���PY_CPPFLAGSt���PY_CORE_CFLAGSt���_OSX_SUPPORT_INITIAL_c���������C���s����|�d�k�r�t�j�d�}�n��|�j�t�j���}�t�j�j�|����\�}�}�t�j�d�k�sd�t�j �d�k�r}�|�d�k�r}�|��d�}��n��t�j�j �|����s��x9�|�D]1�}�t�j�j�|�|����}�t�j�j �|���r��|�Sq��Wd�S|��Sd�S(���s����Tries to find 'executable' in the directories listed in 'path'. A string listing directories separated by 'os.pathsep'; defaults to os.environ['PATH']. Returns the complete filename or None if not found. t���PATHt���win32t���os2s���.exeN(���t���Nonet���ost���environt���splitt���pathsept���patht���splitextt���syst���platformt���namet���isfilet���join(���t ���executableR���t���pathst���baset���extt���pt���f(����(����s$���/usr/lib64/python2.7/_osx_support.pyt���_find_executable���s����* c���������C���s����d�d�l��}�y�d�d�l�}�|�j����}�Wn-�t�k �rW�t�d�t�j����f�d���}�n�X|�j�|����=�}�d�|��|�j�f�}�t�j �|���s��|�j ����j����Sd�SWd�QXd�S(���s0���Output from successful command execution or Nonei����Ns���/tmp/_osx_support.%ss���w+bs���%s 2>/dev/null >'%s'( ���t ���contextlibt���tempfilet���NamedTemporaryFilet���ImportErrort���openR���t���getpidt���closingR���t���systemt���readt���stripR���(���t ���commandstringR'���R(���t���fpt���cmd(����(����s$���/usr/lib64/python2.7/_osx_support.pyt���_read_output7���s���� c���������C���s#���t��|����p"�t�d�|��f���p"�d�S(���s0���Find a build tool on current path or using xcruns���/usr/bin/xcrun -find %st����(���R&���R4���(���t���toolname(����(����s$���/usr/lib64/python2.7/_osx_support.pyt���_find_build_toolJ���s����c����������C���s����t��d�k�r��d�a��y�t�d���}��Wn�t�k �r5�q��Xz�t�j�d�|��j������}�Wd�|��j����X|�d�k �r��d�j�|�j �d���j �d���d� ��a��q��n��t��S(���s*���Return the OS X system version as a stringR5���s0���/System/Library/CoreServices/SystemVersion.plists=���<key>ProductUserVisibleVersion</key>\s*<string>(.*?)</string>Nt���.i���i���(���t���_SYSTEM_VERSIONR���R+���t���IOErrort���ret���searchR/���t���closeR���t���groupR���(���R%���t���m(����(����s$���/usr/lib64/python2.7/_osx_support.pyt���_get_system_versionS���s���� +c���������C���s4���x-�t��|����D]�}�|�j�t���r �|��|�=q �q �Wd�S(���s-���Remove original unmodified values for testingN(���t���listt ���startswitht���_INITPRE(���t���_config_varst���k(����(����s$���/usr/lib64/python2.7/_osx_support.pyt���_remove_original_valuesq���s����c���������C���sM���|��j��|�d���}�|�|�k�r?�t�|�|��k�r?�|�|��t�|�<n��|�|��|�<d�S(���s@���Save modified and original unmodified value of configuration varR5���N(���t���getRC���(���RD���t���cvt���newvaluet���oldvalue(����(����s$���/usr/lib64/python2.7/_osx_support.pyt���_save_modified_valuex���s����c����������C���si���t�����}��|��rO�y#�t�d����|��j�d���D����}��WqO�t�k �rK�d�}��qO�Xn��|��re�t�|��d�k���St�S(���s=���Returns True if universal builds are supported on this systemc���������s���s���|��]�}�t��|���Vq�d��S(���N(���t���int(���t���.0t���i(����(����s$���/usr/lib64/python2.7/_osx_support.pys ���<genexpr>����s����R8���R5���i ���i���(���i ���i���(���R@���t���tupleR���t ���ValueErrort���boolt���False(���t���osx_version(����(����s$���/usr/lib64/python2.7/_osx_support.pyt���_supports_universal_builds����s���� # c���������C���sD��d�t��j�k�r�|��S|��d�j����d�}�}�t�|���sF�t�d���}�n^�t��j�j�|���j�d���r��t�d�|�j �d�d���f���}�|�r��d�|�k�r��t�d���}�q��n��|�s��t �d �����n��|�|�k�r@xx�t�D]m�}�|�|��k�r��|�t��j�k�r��|��|�j����}�|�d �k�r|�n�|�d�|�d�<t�|��|�d�j �|�����q��q��Wn��|��S( ���s7���Find appropriate C compiler for extension module buildsR ���i����t���clangt���gccs���'%s' --versiont���'s���'"'"'s���llvm-gccs���Cannot locate working compilerR���s���++t��� (���R���R���R���R&���R7���R���t���basenameRB���R4���t���replacet���SystemErrort���_COMPILER_CONFIG_VARSRK���R���(���RD���t���cct���oldcct���dataRH���t���cv_split(����(����s$���/usr/lib64/python2.7/_osx_support.pyt���_find_appropriate_compiler����s(���� #c���������C���sw���xp�t��D]h�}�|�|��k�r�|�t�j�k�r�|��|�}�t�j�d�d�|���}�t�j�d�d�|���}�t�|��|�|���q�q�W|��S(���s5���Remove all universal build arguments from config varss ���-arch\s+\w+\sRX���s���-isysroot [^ ]*(���t���_UNIVERSAL_CONFIG_VARSR���R���R;���t���subRK���(���RD���RH���t���flags(����(����s$���/usr/lib64/python2.7/_osx_support.pyt���_remove_universal_flags����s���� c���������C���s����d�t��j�k�r�|��St�j�d�|��d���d �k �r��t��j�d�|��d�j�d�d���f���}�|�r��x^�t�D]S�}�|�|��k�rb�|�t��j�k�rb�|��|�}�t�j�d�d�|���}�t �|��|�|���qb�qb�Wq��n��|��S( ���s-���Remove any unsupported archs from config varsR ���s���-arch\s+ppcR���sN���echo 'int main{};' | '%s' -c -arch ppc -x c -o /dev/null /dev/null 2>/dev/nullRW���s���'"'"'s���-arch\s+ppc\w*\sRX���N( ���R���R���R;���R<���R���R.���RZ���Rb���Rc���RK���(���RD���t���statusRH���Rd���(����(����s$���/usr/lib64/python2.7/_osx_support.pyt���_remove_unsupported_archs����s���� c���������C���s����d�t��j�k�r��t��j�d�}�xm�t�D]b�}�|�|��k�r#�d�|��|�k�r#�|��|�}�t�j�d�d�|���}�|�d�|�}�t�|��|�|���q#�q#�Wn��|��S(���s2���Allow override of all archs with ARCHFLAGS env vart ���ARCHFLAGSs���-archs ���-arch\s+\w+\sRX���(���R���R���Rb���R;���Rc���RK���(���RD���t���archRH���Rd���(����(����s$���/usr/lib64/python2.7/_osx_support.pyt���_override_all_archs��s���� c���������C���s����|��j��d�d���}�t�j�d�|���}�|�d�k �r��|�j�d���}�t�j�j�|���s��x^�t�D]S�}�|�|��k�rX�|�t�j �k�rX�|��|�}�t�j �d�d�|���}�t�|��|�|���qX�qX�Wq��n��|��S(���s+���Remove references to any SDKs not availableR���R5���s���-isysroot\s+(\S+)i���s���-isysroot\s+\S+(?:\s|$)RX���N(���RG���R;���R<���R���R>���R���R���t���existsRb���R���Rc���RK���(���RD���t���cflagsR?���t���sdkRH���Rd���(����(����s$���/usr/lib64/python2.7/_osx_support.pyt���_check_for_unavailable_sdk��s���� c���������C���s���t��}�}�t�|����}��t����s,�t�}�}�n�d�|�k�}�d�|�k�}�|�sY�d�t�j�k�r��xC�t�r��y!�|��j�d���}�|��|�|�d�5Wq\�t�k �r��Pq\�Xq\�Wn��d�t�j�k�r��|�r��|��t�j�d�j����}��n��|�rxC�t�ry!�|��j�d���}�|��|�|�d�5Wq��t�k �rPq��Xq��Wn��d �}�d�|�k�rM|�j�d���}�|�|�d�}�n,�d�|��k�ry|��j�d���}�|��|�d�}�n��|�r�t�j �j�|���r�d�d�l�m �}�|�j�d�|���|�j�d ���n��|��S(���se�� This function will strip '-isysroot PATH' and '-arch ARCH' from the compile flags if the user has specified one them in extra_compile_flags. This is needed because '-arch ARCH' adds another architecture to the build, without a way to remove an architecture. Furthermore GCC will barf if multiple '-isysroot' arguments are present. s���-archs ���-isysrootRh���i���i���i����(���t���logs4���Compiling with an SDK that doesn't seem to exist: %ss$���Please check your Xcode installationN(���RR���RA���RT���t���TrueR���R���t���indexRP���R���R���R���t���isdirt ���distutilsRo���t���warn(���t���compiler_sot���cc_argst ���stripArcht���stripSysrootRq���t���sysroott���idxRo���(����(����s$���/usr/lib64/python2.7/_osx_support.pyR����0��sF���� c���������C���s.���t�����s�t�|����n��t�|����t�|����|��S(���s���Customize Python build configuration variables. Called internally from sysconfig with a mutable mapping containing name/value pairs parsed from the configured makefile used to build this interpreter. Returns the mapping updated as needed to reflect the environment in which the interpreter is running; in the case of a Python from a binary installer, the installed environment may be very different from the build environment, i.e. different OS levels, different built tools, different available CPU architectures. This customization is performed whenever distutils.sysconfig.get_config_vars() is first called. It may be used in environments where no compilers are present, i.e. when installing pure Python dists. Customization of compiler paths and detection of unavailable archs is deferred until the first extension module build is requested (in distutils.sysconfig.customize_compiler). Currently called from distutils.sysconfig (���RT���Re���Rj���Rn���(���RD���(����(����s$���/usr/lib64/python2.7/_osx_support.pyR���p��s ���� c���������C���s"���t��|����t�|����t�|����|��S(���s����Customize compiler path and configuration variables. This customization is performed when the first extension module build is requested in distutils.sysconfig.customize_compiler). (���Ra���Rg���Rj���(���RD���(����(����s$���/usr/lib64/python2.7/_osx_support.pyR������s���� c���������C���s��|��j��d�d���}�t����p�|�}�|�p*�|�}�|�r�|�}�d�}�|��j��t�d�|��j��d�d�����}�|�r��y*�t�d����|�j�d���d�d�!D����}�Wq��t�k �r��d�}�q��Xn�d�}�|�d�k�r�d�|�j����k�r�d�}�t�j�d �|���}�t�t �t �|�������}�t�|���d�k�r!|�d�}�q�|�d�k�r6d�}�q�|�d�k�rKd�}�q�|�d �k�r`d�}�q�|�d!�k�rud�}�q�|�d"�k�r�d�}�q�t�d�|�f�����q�|�d�k�r�t�j �d#�k�r�d�}�q�q�|�d$�k�r�t�j �d%�k�r�d�}�q�d�}�q�n��|�|�|�f�S(&���s ���Filter values for get_platform()t���MACOSX_DEPLOYMENT_TARGETR5���t���macosxR���c���������s���s���|��]�}�t��|���Vq�d��S(���N(���RL���(���RM���RN���(����(����s$���/usr/lib64/python2.7/_osx_support.pys ���<genexpr>���s����R8���i����i���i ���i���s���-archt���fats ���-arch\s+(\S+)i���t���i386t���ppct���x86_64t���intelt���fat3t���ppc64t���fat64t ���universals%���Don't know machine value for archs=%ri ���t���PowerPCt���Power_Macintosh(���i ���i����(���i ���i����(���i ���i���(���R~���R���(���R~���R����(���R~���R���R����(���R����R����(���R~���R���R����R����I�������(���R����R����I�������(���RG���R@���RC���RO���R���RP���R0���R;���t���findallt���sortedt���sett���lenR���t���maxint(���RD���t���osnamet���releaset���machinet���macvert ���macreleaseRl���t���archs(����(����s$���/usr/lib64/python2.7/_osx_support.pyR������sP���� * (���R���R���R���R���R���R ���R ���R���R���R ���R���R���(���R���R ���R ���R���(���t���__doc__R���R;���R���t���__all__Rb���R\���RC���R���R&���R4���R7���R9���R@���RF���RK���RT���Ra���Re���Rg���Rj���Rn���R����R���R���R���(����(����(����s$���/usr/lib64/python2.7/_osx_support.pyt���<module>���s<��� ��� > ( @ )