Lines Matching full:warnings
5 To use this tool, first run `python -Qwarnall yourscript.py 2>warnings'.
8 `warnings'. The warnings look like this:
12 The warnings are written to stderr, so you must use `2>' for the I/O
17 The warnings are not limited to the script; modules imported by the
18 script may also trigger warnings. In fact a useful technique is to
22 Then run `python fixdiv.py warnings'. This first reads the warnings,
23 looking for classic division warnings, and sorts them by file name and
25 it parses the file and tries to match the warnings up to the division
58 A / operator was found for which no warnings were seen. This could
68 - 'Phantom ... warnings for line N', line marked by '*':
75 script was run to collect warnings and the time fixdiv was run.
81 statement split across multiple lines. Because the warnings
106 - This tool never looks at the // operator; no warnings are ever
110 statement is in effect; no warnings are generated in this case, and
115 - Warnings may be issued for code not read from a file, but executed
120 warnings (see above). You're on your own to deal with these. You
123 should not issue any warnings. If there are any, and you have a
158 warnings = readwarnings(args[0])
159 if warnings is None:
161 files = list(warnings.keys())
163 print("No classic division warnings read from", args[0])
168 x = process(filename, warnings[filename])
174 sys.stderr.write("Usage: %s [-m] warnings\n" % sys.argv[0])
182 warnings = {}
199 list = warnings.get(filename)
201 warnings[filename] = list = []
203 return warnings
230 warnings = []
232 warnings.append(list[index])
234 if not slashes and not warnings:
236 elif slashes and not warnings:
238 elif warnings and not slashes:
239 reportphantomwarnings(warnings, f)
259 for lineno, what in warnings:
292 def reportphantomwarnings(warnings, f): argument
296 for row, what in warnings:
304 print("*** Phantom %s warnings for line %d:" % (whats, row))