KCx d Z ddlZddlZddlZddlZddlZddlZddlm Z ddl mZ ddlm Z ddlmZ ddlmZ d Zd Zd Zd Zdad Zd ZddZdxaxaad Zd ZddZd Z ddZd Z ddZ! ddZ" G d d Z#dS ) zudistutils.util Miscellaneous utility functions -- anything that doesn't fit into one of the other *util.py modules. N)DistutilsPlatformError)newer)spawn)log)DistutilsByteCompileErrorc t j dk rrdt j v rdS dt j v rdS dt j v rdS t j S dt j v rt j d S t j d k st t d st j S t j \ } }}}}| dd } | d d }| dd }| dd dk r| d|S | dd dk rQ|d dk rDd} dt |d dz |dd fz }ddd}|d|t j z z }n| dd dk rddlm } | S | dd d!k rMd!} t j d"t j }| | }|r| }nI| dd d#k r;ddl} ddl} | | j | || \ } }}| d|d|S )$a Return a string that identifies the current platform. This is used mainly to distinguish platform-specific build directories and platform-specific built distributions. Typically includes the OS name and version and the architecture (as supplied by 'os.uname()'), although the exact information included depends on the OS; eg. on Linux, the kernel version isn't particularly important. Examples of returned values: linux-i586 linux-alpha (?) solaris-2.6-sun4u Windows will return one of: win-amd64 (64bit Windows on AMD64 (aka x86_64, Intel64, EM64T, etc) win32 (all others - specifically, sys.platform is returned) For other non-POSIX platforms, currently just returns 'sys.platform'. ntamd64 win-amd64z(arm) win-arm32z(arm64)z win-arm64_PYTHON_HOST_PLATFORMposixuname/ _-N linuxsunosr 5solarisz%d.%s 32bit64bit)il z.%saix)aix_platform cygwinz[\d.]+darwin)osnamesysversionlowerplatformenvironhasattrr replaceintmaxsize_aix_supportr recompileASCIImatchgroup_osx_supportdistutils.sysconfigget_platform_osx sysconfigget_config_vars)osnamehostreleaser&