/usr/lib64/python2.7/Tools/scripts
NameSizeModeActions
analyze_dxp.py42050755editdlrm
analyze_dxp.pyc47480644editdlrm
analyze_dxp.pyo47480644editdlrm
byext.py39440755editdlrm
byext.pyc45210644editdlrm
byext.pyo45210644editdlrm
byteyears.py16370755editdlrm
byteyears.pyc13980644editdlrm
byteyears.pyo13980644editdlrm
checkappend.py46570755editdlrm
checkappend.pyc48860644editdlrm
checkappend.pyo48860644editdlrm
checkpip.py7570755editdlrm
checkpip.pyc10440644editdlrm
checkpip.pyo10440644editdlrm
checkpyc.py20100755editdlrm
checkpyc.pyc19760644editdlrm
checkpyc.pyo19760644editdlrm
classfix.py59520755editdlrm
classfix.pyc41890644editdlrm
classfix.pyo41890644editdlrm
cleanfuture.py85770755editdlrm
cleanfuture.pyc73940644editdlrm
cleanfuture.pyo73610644editdlrm
combinerefs.py43800755editdlrm
combinerefs.pyc42560644editdlrm
combinerefs.pyo42230644editdlrm
copytime.py6630755editdlrm
copytime.pyc9370644editdlrm
copytime.pyo9370644editdlrm
crlf.py6100755editdlrm
crlf.pyc8550644editdlrm
crlf.pyo8550644editdlrm
cvsfiles.py17860755editdlrm
cvsfiles.pyc21630644editdlrm
cvsfiles.pyo21630644editdlrm
db2pickle.py35700755editdlrm
db2pickle.pyc34970644editdlrm
db2pickle.pyo34970644editdlrm
diff.py20660755editdlrm
diff.pyc23860644editdlrm
diff.pyo23860644editdlrm
dutree.py16150755editdlrm
dutree.pyc22300644editdlrm
dutree.pyo22300644editdlrm
eptags.py14830755editdlrm
eptags.pyc18760644editdlrm
eptags.pyo18760644editdlrm
finddiv.py25170755editdlrm
finddiv.pyc32960644editdlrm
finddiv.pyo32960644editdlrm
findlinksto.py10690755editdlrm
findlinksto.pyc14250644editdlrm
findlinksto.pyo14250644editdlrm
findnocoding.py28080755editdlrm
findnocoding.pyc32010644editdlrm
findnocoding.pyo32010644editdlrm
find_recursionlimit.py34730755editdlrm
find_recursionlimit.pyc56730644editdlrm
find_recursionlimit.pyo56730644editdlrm
fixcid.py99950755editdlrm
fixcid.pyc78510644editdlrm
fixcid.pyo78510644editdlrm
fixdiv.py138410755editdlrm
fixdiv.pyc138490644editdlrm
fixdiv.pyo137660644editdlrm
fixheader.py11890755editdlrm
fixheader.pyc14710644editdlrm
fixheader.pyo14710644editdlrm
fixnotice.py30510755editdlrm
fixnotice.pyc35000644editdlrm
fixnotice.pyo35000644editdlrm
fixps.py8930755editdlrm
fixps.pyc9690644editdlrm
fixps.pyo9690644editdlrm
google.py5190755editdlrm
google.pyc7920644editdlrm
google.pyo7920644editdlrm
gprof2html.py21670755editdlrm
gprof2html.pyc22770644editdlrm
gprof2html.pyo22770644editdlrm
h2py.py59530755editdlrm
h2py.pyc43920644editdlrm
h2py.pyo43920644editdlrm
hotshotmain.py14830755editdlrm
hotshotmain.pyc18630644editdlrm
hotshotmain.pyo18630644editdlrm
ifdef.py37180755editdlrm
ifdef.pyc22650644editdlrm
ifdef.pyo22650644editdlrm
lfcr.py6180755editdlrm
lfcr.pyc8800644editdlrm
lfcr.pyo8800644editdlrm
linktree.py24240755editdlrm
linktree.pyc20250644editdlrm
linktree.pyo20250644editdlrm
lll.py7420755editdlrm
lll.pyc9420644editdlrm
lll.pyo9420644editdlrm
logmerge.py55750755editdlrm
logmerge.pyc50830644editdlrm
logmerge.pyo50830644editdlrm
mailerdaemon.py79420755editdlrm
mailerdaemon.pyc73640644editdlrm
mailerdaemon.pyo73640644editdlrm
md5sum.py23850755editdlrm
md5sum.pyc29170644editdlrm
md5sum.pyo29170644editdlrm
methfix.py54620755editdlrm
methfix.pyc41250644editdlrm
methfix.pyo41250644editdlrm
mkreal.py16270755editdlrm
mkreal.pyc19800644editdlrm
mkreal.pyo19800644editdlrm
ndiff.py38080755editdlrm
ndiff.pyc38590644editdlrm
ndiff.pyo38590644editdlrm
nm2def.py24430755editdlrm
nm2def.pyc29600644editdlrm
nm2def.pyo29600644editdlrm
objgraph.py60170755editdlrm
objgraph.pyc49330644editdlrm
objgraph.pyo49330644editdlrm
parseentities.py17190755editdlrm
parseentities.pyc20770644editdlrm
parseentities.pyo20770644editdlrm
patchcheck.py76790755editdlrm
patchcheck.pyc91280644editdlrm
patchcheck.pyo91280644editdlrm
pathfix.py43290755editdlrm
pathfix.pyc38380644editdlrm
pathfix.pyo38380644editdlrm
pdeps.py39360755editdlrm
pdeps.pyc32200644editdlrm
pdeps.pyo32200644editdlrm
pickle2db.py39420755editdlrm
pickle2db.pyc38190644editdlrm
pickle2db.pyo38190644editdlrm
pindent.py171700755editdlrm
pindent.pyc115590644editdlrm
pindent.pyo115590644editdlrm
ptags.py12240755editdlrm
ptags.pyc14070644editdlrm
ptags.pyo14070644editdlrm
pysource.py38460755editdlrm
pysource.pyc40090644editdlrm
pysource.pyo40090644editdlrm
redemo.py57920755editdlrm
redemo.pyc52490644editdlrm
redemo.pyo52490644editdlrm
reindent-rst.py2780755editdlrm
reindent-rst.pyc4810644editdlrm
reindent-rst.pyo4810644editdlrm
reindent.py114170755editdlrm
reindent.pyc96290644editdlrm
reindent.pyo95900644editdlrm
rgrep.py14920755editdlrm
rgrep.pyc18810644editdlrm
rgrep.pyo18810644editdlrm
serve.py11470755editdlrm
serve.pyc15970644editdlrm
serve.pyo15970644editdlrm
setup.py4210644editdlrm
setup.pyc5480644editdlrm
setup.pyo5480644editdlrm
suff.py6210755editdlrm
suff.pyc9040644editdlrm
suff.pyo9040644editdlrm
svneol.py29300755editdlrm
svneol.pyc29040644editdlrm
svneol.pyo28250644editdlrm
texcheck.py92560644editdlrm
texcheck.pyc83760644editdlrm
texcheck.pyo83760644editdlrm
texi2html.py698250755editdlrm
texi2html.pyc833230644editdlrm
texi2html.pyo833230644editdlrm
treesync.py57830755editdlrm
treesync.pyc59900644editdlrm
treesync.pyo59900644editdlrm
untabify.py12150755editdlrm
untabify.pyc15830644editdlrm
untabify.pyo15830644editdlrm
which.py16300755editdlrm
which.pyc16320644editdlrm
which.pyo16320644editdlrm
win_add2path.py16200644editdlrm
win_add2path.pyc20690644editdlrm
win_add2path.pyo20690644editdlrm
xxci.py27970755editdlrm
xxci.pyc40170644editdlrm
xxci.pyo40170644editdlrm
Edit: /usr/lib64/python2.7/Tools/scripts/fixdiv.pyo (13766B)
ó fc@sÀdZddlZddlZddlZddlZdad„Zd„ZdZd„Z d„Z d „Z d „Z d dd „ƒYZ d „Zd„Zedkr¼ejeƒƒndS(s(fixdiv - tool to fix division operators. To use this tool, first run `python -Qwarnall yourscript.py 2>warnings'. This runs the script `yourscript.py' while writing warning messages about all uses of the classic division operator to the file `warnings'. The warnings look like this: :: DeprecationWarning: classic division The warnings are written to stderr, so you must use `2>' for the I/O redirect. I know of no way to redirect stderr on Windows in a DOS box, so you will have to modify the script to set sys.stderr to some kind of log file if you want to do this on Windows. The warnings are not limited to the script; modules imported by the script may also trigger warnings. In fact a useful technique is to write a test script specifically intended to exercise all code in a particular module or set of modules. Then run `python fixdiv.py warnings'. This first reads the warnings, looking for classic division warnings, and sorts them by file name and line number. Then, for each file that received at least one warning, it parses the file and tries to match the warnings up to the division operators found in the source code. If it is successful, it writes its findings to stdout, preceded by a line of dashes and a line of the form: Index: If the only findings found are suggestions to change a / operator into a // operator, the output is acceptable input for the Unix 'patch' program. Here are the possible messages on stdout (N stands for a line number): - A plain-diff-style change ('NcN', a line marked by '<', a line containing '---', and a line marked by '>'): A / operator was found that should be changed to //. This is the recommendation when only int and/or long arguments were seen. - 'True division / operator at line N' and a line marked by '=': A / operator was found that can remain unchanged. This is the recommendation when only float and/or complex arguments were seen. - 'Ambiguous / operator (..., ...) at line N', line marked by '?': A / operator was found for which int or long as well as float or complex arguments were seen. This is highly unlikely; if it occurs, you may have to restructure the code to keep the classic semantics, or maybe you don't care about the classic semantics. - 'No conclusive evidence on line N', line marked by '*': A / operator was found for which no warnings were seen. This could be code that was never executed, or code that was only executed with user-defined objects as arguments. You will have to investigate further. Note that // can be overloaded separately from /, using __floordiv__. True division can also be separately overloaded, using __truediv__. Classic division should be the same as either of those. (XXX should I add a warning for division on user-defined objects, to disambiguate this case from code that was never executed?) - 'Phantom ... warnings for line N', line marked by '*': A warning was seen for a line not containing a / operator. The most likely cause is a warning about code executed by 'exec' or eval() (see note below), or an indirect invocation of the / operator, for example via the div() function in the operator module. It could also be caused by a change to the file between the time the test script was run to collect warnings and the time fixdiv was run. - 'More than one / operator in line N'; or 'More than one / operator per statement in lines N-N': The scanner found more than one / operator on a single line, or in a statement split across multiple lines. Because the warnings framework doesn't (and can't) show the offset within the line, and the code generator doesn't always give the correct line number for operations in a multi-line statement, we can't be sure whether all operators in the statement were executed. To be on the safe side, by default a warning is issued about this case. In practice, these cases are usually safe, and the -m option suppresses these warning. - 'Can't find the / operator in line N', line marked by '*': This really shouldn't happen. It means that the tokenize module reported a '/' operator but the line it returns didn't contain a '/' character at the indicated position. - 'Bad warning for line N: XYZ', line marked by '*': This really shouldn't happen. It means that a 'classic XYZ division' warning was read with XYZ being something other than 'int', 'long', 'float', or 'complex'. Notes: - The augmented assignment operator /= is handled the same way as the / operator. - This tool never looks at the // operator; no warnings are ever generated for use of this operator. - This tool never looks at the / operator when a future division statement is in effect; no warnings are generated in this case, and because the tool only looks at files for which at least one classic division warning was seen, it will never look at files containing a future division statement. - Warnings may be issued for code not read from a file, but executed using an exec statement or the eval() function. These may have in the filename position, in which case the fixdiv script will attempt and fail to open a file named '' and issue a warning about this failure; or these may be reported as 'Phantom' warnings (see above). You're on your own to deal with these. You could make all recommended changes and add a future division statement to all affected files, and then re-run the test script; it should not issue any warnings. If there are any, and you have a hard time tracking down where they are generated, you can use the -Werror option to force an error instead of a first warning, generating a traceback. - The tool should be run from the same directory as that from which the original script was run, otherwise it won't be able to open files given by relative pathnames. iÿÿÿÿNic CsJy#tjtjddƒ\}}Wn!tjk rF}t|ƒdSXx>|D]6\}}|dkrotGHdS|dkrNdaqNqNW|sœtdƒdS|drÃtjjdtjdƒnt |dƒ}|dkrãdS|j ƒ}|sd G|dGHdS|j ƒd}x-|D]%}t |||ƒ} |p?| }qW|S( Nithmis-hs-ms&at least one file argument is requireds!%s: extra file arguments ignored is&No classic division warnings read from(tgetopttsystargvterrortusaget__doc__tmulti_oktstderrtwritet readwarningstNonetkeystsorttprocess( toptstargstmsgtotatwarningstfilestexittfilenametx((s,/usr/lib64/python2.7/Tools/scripts/fixdiv.pytmainŒs:#           cCs[tjjdtjd|fƒtjjdtjdƒtjjdtjdƒdS(Ns%s: %s isUsage: %s [-m] warnings s"Try `%s -h' for more information. (RRR R(R((s,/usr/lib64/python2.7/Tools/scripts/fixdiv.pyR¬s!sL^(.+?):(\d+): DeprecationWarning: classic (int|long|float|complex) division$c Cs"tjtƒ}yt|ƒ}Wn(tk rI}tjjd|ƒdSXi}xÁ|jƒ}|siPn|j |ƒ}|s°|j dƒdkrStjjd|ƒqSqSn|j ƒ\}}} |j |ƒ} | dkrñg||<} n| jt|ƒt| ƒfƒqSW|jƒ|S(Nscan't open: %s tdivisionisWarning: ignored input (tretcompiletPATTERNtopentIOErrorRRR treadlinetmatchtfindtgroupstgetR tappendtinttinterntclose( t warningsfiletprogtfRRtlinetmRtlinenotwhattlist((s,/usr/lib64/python2.7/Tools/scripts/fixdiv.pyR ´s.  # cCsddGHyt|ƒ}Wn(tk rC}tjjd|ƒdSXdG|GHt|ƒ}|jƒd}tj|j ƒ}xzt |ƒ\}}} } |dkr§Png} xE|t |ƒkrô||d|krô| j ||ƒ|d7}q°W| r t| |ƒng} xE|t |ƒkrX||d|krX| j ||ƒ|d7}qW| rj| rjq~| r‡| r‡t| dƒq~| r¤| r¤t| |ƒq~t | ƒdkrMtsMg} d}x?| D]7\\}}}||króqÏn| j |ƒ|}qÏWt | ƒdkr,dG| dGHqJd Gd | d| d fGHqMng}g}g}xY| D]Q\}}|dkrŽ|j |ƒqf|dkrª|j |ƒqf|j |ƒqfWd}x0| D](\\}}}||krìqÈn|}t|ƒ}|||d!dkr-d|GHdG|GHqÈn|rLd|G|GHdG|GHqÈ|r’| r’d||fGHdG|GHdGHdG|| d||GHqÈ|r´| r´d|GHdG|GHqÈ|rÈ|rÈddj|ƒdj|ƒ|fGHdG|GHqÈqÈWq~W|jƒdS(Nt-iFscan't open: %s isIndex:isNo conclusive evidences$*** More than one / operator in lines**** More than one / operator per statementsin lines %d-%diÿÿÿÿR&tlongtfloattcomplext/s)*** Can't find the / operator in line %d:t*s*** Bad warning for line %d:s%dc%dts$True division / operator at line %d:t=s-*** Ambiguous / operator (%s, %s) at line %d:t|t?(R&R2(R3R4(RRRRR t FileContextR ttokenizetgenerate_tokensR tscanlineR tlenR%treportphantomwarningstreportRtchoptjoinR((RR0tfpRR+tindextgt startlinenot endlinenotslashestlineinfotorphansRtrowstlastrowtrowtcolR,tintlongt floatcomplextbadR.R/((s,/usr/lib64/python2.7/Tools/scripts/fixdiv.pyRÍsž     ))                   !c Cs¯g}d}d}xF|D]>\}}||krJ|g}|j|ƒn|j|ƒqWxM|D]E}|d}dj|dƒ}d||fGH|j|ddƒqbWdS(NiR5is$*** Phantom %s warnings for line %d:tmarkR6(R R%RDRB( RR+tblocksRNt lastblockROR/tblocktwhats((s,/usr/lib64/python2.7/Tools/scripts/fixdiv.pyRA$s    cCsZd}xM|D]E\\}}}||kr d||fGHdGt|ƒGH|}q q WdS(Ns*** %s on line %d:R6(R RC(RJtmessageRNRORPR,((s,/usr/lib64/python2.7/Tools/scripts/fixdiv.pyRB3s  R<cBsAeZddd„Zd„Zd„Zd„Zddd„ZRS( iicCs:||_d|_d|_d|_g|_g|_dS(Niii(REtwindowR.t eoflookaheadt lookaheadtbuffer(tselfRERZR.((s,/usr/lib64/python2.7/Tools/scripts/fixdiv.pyt__init__<s      cCs_xXt|jƒ|jkrZ|j rZ|jjƒ}|sGd|_Pn|jj|ƒqWdS(Ni(R@R\RZR[RER R%(R^R,((s,/usr/lib64/python2.7/Tools/scripts/fixdiv.pytfillCs % cCsL|jƒ|jsdS|jjdƒ}|jj|ƒ|jd7_|S(Ntii(R`R\tpopR]R%R.(R^R,((s,/usr/lib64/python2.7/Tools/scripts/fixdiv.pyR Js  cCsŸ|jƒ|jt|jƒ}|jt|jƒ}||koP|jknrd|j||S|j|ko~|knr•|j||jSt‚dS(N(R`R.R@R]R\tKeyError(R^RFtbufstarttlookend((s,/usr/lib64/python2.7/Tools/scripts/fixdiv.pyt __getitem__Rs R6cCsn|dkr|}nxRt||dƒD]=}y||}Wntk rVd}nX|Gt|ƒGHq)WdS(Nis(R trangeRcRC(R^tfirsttlastRTtiR,((s,/usr/lib64/python2.7/Tools/scripts/fixdiv.pyRB[s    N(t__name__t __module__R_R`R RfR RB(((s,/usr/lib64/python2.7/Tools/scripts/fixdiv.pyR<;s    c Cs“g}d}d}xq|D]i\}}}}}|d}|dkrM|}n|dkro|j||fƒn|tjkrPqqW|||fS(NiR5s/=(R5s/=(R R%R=tNEWLINE( RGRJRHRIttypettokentstarttendR,((s,/usr/lib64/python2.7/Tools/scripts/fixdiv.pyR?es    cCs|jdƒr|d S|SdS(Ns iÿÿÿÿ(tendswith(R,((s,/usr/lib64/python2.7/Tools/scripts/fixdiv.pyRCsst__main__((RRRRR=RRRRR RRARBR<R?RCRkR(((s,/usr/lib64/python2.7/Tools/scripts/fixdiv.pytƒs"       W  *