U C^5 @sdZddlZddlZddlZzddlmZWn ek rLddlmZYnXdddgZGdddZGd ddZ Gd ddZ ej d kre Z nej d kre Z dS) zq Helper functions for interacting with the shell, and consuming shell-style parameters provided in config files. Nquote WindowsParser PosixParser NativeParserc@s(eZdZdZeddZeddZdS)CommandLineParsera  An object that knows how to split and join command-line arguments. It must be true that ``argv == split(join(argv))`` for all ``argv``. The reverse neednt be true - `join(split(cmd))` may result in the addition or removal of unnecessary escaping. cCstdS)z5 Join a list of arguments into a command line string NNotImplementedErrorargvr ?/tmp/pip-install-6_kvzl1k/numpy/numpy/distutils/_shell_utils.pyjoinszCommandLineParser.joincCstdS)z6 Split a command line string into a list of arguments Nrcmdr r r splitszCommandLineParser.splitN__name__ __module__ __qualname____doc__ staticmethodrrr r r r rs  rc@s(eZdZdZeddZeddZdS)rz The parsing behavior used by `subprocess.call("string")` on Windows, which matches the Microsoft C/C++ runtime. Note that this is _not_ the behavior of cmd. cCs t|SN) subprocess list2cmdliner r r r r*szWindowsParser.joincsddl}z |jWntk r*tYnX|s4gSd|}|jjj}||j|_|j||j f|_ | }||| |fddt |j D}|jjrt|ddkst|ddS)Nrzdummy csg|] }|qSr r ).0iZlpargsr r Csz'WindowsParser.split..dummy)ctypeswindllAttributeErrorr shell32CommandLineToArgvWPOINTER c_wchar_prestypec_intargtypesbyrefrangevaluekernel32Z LocalFreeAssertionError)rr!r%nargsargsr rr r/s"   zWindowsParser.splitNrr r r r r#s  c@s(eZdZdZeddZeddZdS)rzX The parsing behavior used by `subprocess.call("string", shell=True)` on Posix. cCsddd|DS)N css|]}t|VqdSrr)rargr r r Qsz#PosixParser.join..)rr r r r rOszPosixParser.joincCstj|ddS)NT)posix)shlexrrr r r rSszPosixParser.splitNrr r r r rKs  ntr5) rosr6rr ImportErrorZpipes__all__rrrnamerr r r r s (