Your IP : 52.14.255.122


Current Path : /opt/alt/python27/lib64/python2.7/
Upload File :
Current File : //opt/alt/python27/lib64/python2.7/warnings.pyo

�
^
bc@sYdZddlZddlZddlZddddddd	d
gZddd�Zddd
�ZeZdd�Z	de
dddd�Ze
ddd�Zd�Z
defd��YZd�Zd�Zd�Zd�Zddd�Zdddd�Zdefd��YZd
efd��YZeZy>ddlmZmZmZmZmZeZeZ e!ZWn#e"k
r�gZd ZiZ nXeej#�esRe$e%gZ&ej'r�ej(j)r�e&j*e+�nxe&D]Z,ed!d"e,�q�Wej(j-Z-e-dkr$d#Z.ne-r3d Z.nd!Z.ee.d"e/d$d�n[dS(%s&Python part of the warnings subsystem.i����Ntwarnt
warn_explicittshowwarningt
formatwarningtfilterwarningstsimplefiltert
resetwarningstcatch_warningsicCs9tjr5|dkrt}nt|||d�ndS(s�Issue a deprecation warning for Python 3.x related changes.

    Warnings are omitted unless Python is started with the -3 option.
    iN(tsystpy3kwarningtNonetDeprecationWarningR(tmessagetcategoryt
stacklevel((s-/opt/alt/python27/lib64/python2.7/warnings.pytwarnpy3ks		cCsi|dkr(tj}|dkr(dSny#|jt|||||��Wnttfk
rdnXdS(s7Hook to write a warning to a file; replace if you like.N(R
RtstderrtwriteRtIOErrortUnicodeError(RR
tfilenametlinenotfiletline((s-/opt/alt/python27/lib64/python2.7/warnings.pyt
_show_warnings	#cCsFy
t}Wntk
r#d}nXyt|�}Wntk
rGnXd||j|f}|dkr|tj||�n|}|r�|j�}t	||�r�t	|t�r�t|d�}n|d|7}nt	||�r2t	|t�r2t
j�}|r2yt||�}Wq/tk
r+q/Xq2nd||f}|S(s.Function to format a warning the standard way.s%s: %s: %s
tlatin1s  %s
s%s:%s(N(
tunicodet	NameErrortstrtUnicodeEncodeErrort__name__R
t	linecachetgetlinetstript
isinstanceRtgetfilesystemencodingtUnicodeDecodeError(RR
RRRtunicodetypetstenc((s-/opt/alt/python27/lib64/python2.7/warnings.pyR(s0



$

ticCsiddl}||j||j�||j|�t|�f}|rUtj|�ntjd|�dS(s�Insert an entry into the list of warnings filters (at the front).

    'action' -- one of "error", "ignore", "always", "default", "module",
                or "once"
    'message' -- a regex that the warning message must match
    'category' -- a class that the warning must be a subclass of
    'module' -- a regex that the module name must match
    'lineno' -- an integer line number, 0 matches all warnings
    'append' -- if true, append to the list of filters
    i����Ni(tretcompiletItinttfilterstappendtinsert(tactionRR
tmoduleRR.R)titem((s-/opt/alt/python27/lib64/python2.7/warnings.pyRCs
cCsE|d|dt|�f}|r1tj|�ntjd|�dS(s�Insert a simple entry into the list of warnings filters (at the front).

    A simple filter matches all modules and messages.
    'action' -- one of "error", "ignore", "always", "default", "module",
                or "once"
    'category' -- a class that the warning must be a subclass of
    'lineno' -- an integer line number, 0 matches all warnings
    'append' -- if true, append to the list of filters
    iN(R
R,R-R.R/(R0R
RR.R2((s-/opt/alt/python27/lib64/python2.7/warnings.pyR`scCsgt(dS(sAClear the list of warning filters, so that no filters are active.N(R-(((s-/opt/alt/python27/lib64/python2.7/warnings.pyRtst_OptionErrorcBseZdZRS(s,Exception used by option processing helpers.(Rt
__module__t__doc__(((s-/opt/alt/python27/lib64/python2.7/warnings.pyR3xscCsLxE|D]=}yt|�Wqtk
rC}tjdI|IJqXqWdS(NsInvalid -W option ignored:(t
_setoptionR3RR(targstargtmsg((s-/opt/alt/python27/lib64/python2.7/warnings.pyt_processoptions}s

c	Cs[ddl}|jd�}t|�dkrCtd|f��nx#t|�dkrh|jd�qFWg|D]}|j�^qp\}}}}}t|�}|j|�}t|�}|j|�}|r�|d}n|r;y%t	|�}|dkr
t
�nWqAt
tfk
r7td|f��qAXnd}t|||||�dS(	Ni����t:istoo many fields (max 5): %rR(t$isinvalid lineno %r(
R)tsplittlenR3R.R!t
_getactiontescapet_getcategoryR,t
ValueErrort
OverflowErrorR(	R8R)tpartsR&R0RR
R1R((s-/opt/alt/python27/lib64/python2.7/warnings.pyR6�s.+

cCsU|s
dS|dkrdSx!d	D]}|j|�r!|Sq!Wtd|f��dS(
NtdefaulttalltalwaystignoreR1tonceterrorsinvalid action: %r(RERGRHR1RIRJ(t
startswithR3(R0ta((s-/opt/alt/python27/lib64/python2.7/warnings.pyR?�s
cCs/ddl}|stS|jd|�rbyt|�}Wqtk
r^td|f��qXn�|jd�}|| }||d}yt|dd|g�}Wn$t	k
r�td|f��nXyt
||�}Wn$tk
rtd|f��nXt|t�s+td|f��n|S(Ni����s^[a-zA-Z0-9_]+$sunknown warning category: %rt.isinvalid module name: %rsinvalid warning category: %r(
R)tWarningtmatchtevalRR3trfindt
__import__R
tImportErrortgetattrtAttributeErrort
issubclass(R
R)tcattiR1tklasstm((s-/opt/alt/python27/lib64/python2.7/warnings.pyRA�s,



c
CsRt|t�r|j}n|dkr0t}nytj|�}Wn tk
retj}d}nX|j	}|j
}d|kr�|d}nd}|jd�}|r�|j�}|j
d�r |d }q nI|dkrytjd	}Wqtk
r
d}qXn|s |}n|jd
i�}	t||||||	|�dS(
s:Issue a warning, or maybe ignore it or raise an exception.iRs<string>t__file__s.pycs.pyoi����t__main__it__warningregistry__N(s.pycs.pyo(R"RNt	__class__R
tUserWarningRt	_getframeRBt__dict__t	f_globalstf_linenotgettlowertendswithtargvRUt
setdefaultR(
RR
RtcallertglobalsRR1Rtfnltregistry((s-/opt/alt/python27/lib64/python2.7/warnings.pyR�s:	
	
		


	cCsbt|�}|dkrJ|p!d}|dj�dkrJ|d }qJn|dkr_i}nt|t�r�t|�}|j}n|}||�}|||f}|j|�r�dSx�tD]|}	|	\}
}}}
}|dks�|j	|�r�t
||�r�|
dks!|
j	|�r�|dks9||kr�Pq�q�Wt}
|
dkrad||<dStj
||�|
dkr�|�n|
dkr�d||<||f}tj|�r�dSdt|<n�|
d	kr�nt|
d
krd||<||df}|j|�rdSd||<n/|
dkr5d||<ntd|
|	f��t||||�dS(
Ns	<unknown>i����s.pyiRHiRJRIRGR1REs1Unrecognized action (%r) in warnings.filters:
 %s(R,R
ReR"RNRR^RdR-RORVt
defaultactionRtgetlinestonceregistrytRuntimeErrorR(RR
RRR1Rltmodule_globalsttexttkeyR2R0R9RWtmodtlntoncekeytaltkey((s-/opt/alt/python27/lib64/python2.7/warnings.pyR�sb	

	




tWarningMessagecBs,eZdZd	Zd
d
d�Zd�ZRS(s0Holds the result of a single showwarning() call.RR
RRRRcCsR||_||_||_||_||_||_|rE|jnd|_dS(N(	RR
RRRRRR
t_category_name(tselfRR
RRRR((s-/opt/alt/python27/lib64/python2.7/warnings.pyt__init__6s						cCs&d|j|j|j|j|jfS(NsD{message : %r, category : %r, filename : %r, lineno : %s, line : %r}(RRyRRR(Rz((s-/opt/alt/python27/lib64/python2.7/warnings.pyt__str__@s(RR
RRRRN(RR4R5t_WARNING_DETAILSR
R{R|(((s-/opt/alt/python27/lib64/python2.7/warnings.pyRx/s	cBs8eZdZedd�Zd�Zd�Zd�ZRS(s�A context manager that copies and restores the warnings filter upon
    exiting the context.

    The 'record' argument specifies whether warnings should be captured by a
    custom implementation of warnings.showwarning() and be appended to a list
    returned by the context manager. Otherwise None is returned by the context
    manager. The objects appended to the list are arguments whose attributes
    mirror the arguments to showwarning().

    The 'module' argument is to specify an alternative module to the module
    named 'warnings' and imported under that name. This argument is only useful
    when testing the warnings module itself.

    cCs8||_|dkr"tjdn||_t|_dS(s�Specify whether to record warnings and if an alternative module
        should be used other than sys.modules['warnings'].

        For compatibility with Python 3.0, please consider all arguments to be
        keyword-only.

        twarningsN(t_recordR
Rtmodulest_moduletFalset_entered(RztrecordR1((s-/opt/alt/python27/lib64/python2.7/warnings.pyR{Ws	"cCsrg}|jr|jd�n|jtjdk	rL|jd|j�nt|�j}d|dj|�fS(Nsrecord=TrueR~s	module=%rs%s(%s)s, (RR.R�RR�ttypeRtjoin(RzR7tname((s-/opt/alt/python27/lib64/python2.7/warnings.pyt__repr__cs	cs�|jrtd|��nt|_|jj|_|j|j_|jj|_|jr�g��fd�}||j_�SdSdS(NsCannot enter %r twicecs�jt||��dS(N(R.Rx(R7tkwargs(tlog(s-/opt/alt/python27/lib64/python2.7/warnings.pyRus(
R�RptTrueR�R-t_filtersRt_showwarningRR
(RzR((R�s-/opt/alt/python27/lib64/python2.7/warnings.pyt	__enter__ls			cGs>|jstd|��n|j|j_|j|j_dS(Ns%Cannot exit %r without entering first(R�RpR�R�R-R�R(Rztexc_info((s-/opt/alt/python27/lib64/python2.7/warnings.pyt__exit__|s	N(	RR4R5R�R
R{R�R�R�(((s-/opt/alt/python27/lib64/python2.7/warnings.pyRFs
			(R-tdefault_actiont
once_registryRRRERHR
RJR.(0R5RRttypest__all__R
RRRRRNRRRt	ExceptionR3R:R6R?RARRtobjectRxRR�t_warnings_defaultst	_warningsR-R�R�RmRoR�RStwarnoptionst
ImportWarningtPendingDeprecationWarningtsilenceR	tflagstdivision_warningR.Rtclst
bytes_warningtbytes_actiontBytesWarning(((s-/opt/alt/python27/lib64/python2.7/warnings.pyt<module>s`		

				
	)AE(




		

?>