Current File : //opt/imh-python/lib/python2.7/test/symlink_support.pyo
�
��Wc@s�ddlZddlZddlZddlmZd�Zd�Zed�Ze	ed�rjej
nej�dkr�endZ
d�Z
dS(	i����N(tTESTFNcCs�ttdd�}|dk	r"|Std}ytt|�t}Wn tttfk
ret	}nXt
j|�|t_|S(Ntprev_valtcan_symlink(
tgetattrRtNoneRtsymlinktTruetOSErrortNotImplementedErrortAttributeErrortFalsetostremoveR(Rtsymlink_pathtcan((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/symlink_support.pyRs




	cCs,t�}d}|r|Stj|�|�S(s8Skip decorator for tests that require functional symlinks*Requires functional symlink implementation(Rtunittesttskip(ttesttoktmsg((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/symlink_support.pytskip_unless_symlinks	cs�ddl��jjj}�jj�jj�jjf|_�jj|_	��fd����fd��|p�t
jj|�}�||||��dS(s�
    Ctypes symlink implementation since Python doesn't support
    symlinks in windows yet. Borrowed from jaraco.windows project.
    i����Ncs�d}d}d}d}d}d}||B}d}|}	d}
�jj�}d}d}
�jjj|||	|
�j|�||
�}�|�|j}�jjj|�|S(	sr
        Call FormatMessage with a system error number to retrieve
        the descriptive error message.
        ii iiiiiN(	RtwintypestLPWSTRtwindlltkernel32tFormatMessageWtbyreftvaluet	LocalFree(terrnotALLOCATE_BUFFERtARGUMENT_ARRAYtFROM_HMODULEtFROM_STRINGtFROM_SYSTEMtIGNORE_INSERTStflagstsourcet
message_idtlanguage_idt
result_buffertbuffer_sizet	argumentstbytestmessage(tctypesthandle_nonzero_success(sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/symlink_support.pytformat_system_message+s2
	
	cs@|dkr<�jjj�}�|�}t||��ndS(Ni(RRtGetLastErrortWindowsError(tresultRtstrerror(R-R/(sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/symlink_support.pyR.Rs(
tctypes.wintypesRRtCreateSymbolicLinkWRRtDWORDtargtypestBOOLEANtrestypeRtpathtisdir(ttargettlinkttarget_is_directorytCreateSymbolicLink((R-R/R.sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/symlink_support.pyt_symlink_win32s		'RtWindowscCs6ytj|�Wntk
r1tj|�nXdS(N(RtrmdirRR(tname((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/symlink_support.pytremove_symlink_s
(RRtplatformttest.test_supportRRRR
R@thasattrRtsystemRRD(((sm/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/symlink_support.pyt<module>s		>