Use non-integer division (requires Python 2.2+)

- Add "from __future__ import division".  This is the default in
     Python 3, and has been long available in Python 2.
This commit is contained in:
David A. Wheeler 2014-07-29 08:43:27 -04:00
parent 7e655111a9
commit 304225c9bd
1 changed files with 3 additions and 2 deletions

View File

@ -1,5 +1,7 @@
#!/usr/bin/env python
from __future__ import division
"""flawfinder: Find potential security flaws ("hits") in source code.
Usage:
flawfinder [options] [source_code_file]+
@ -35,7 +37,6 @@ version="1.31"
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
import sys, re, string, getopt
import pickle # To support load/save/diff of hitlist
import os, glob, operator # To support filename expansion on Windows
@ -1845,7 +1846,7 @@ def show_final_results():
if time_analyzing > 0 and not omit_time: # Avoid divide-by-zero.
print "in approximately %.2f seconds (%.0f lines/second)" % (
time_analyzing,
(sumlines * 1.0 / time_analyzing) )
(sumlines / time_analyzing) )
else:
print
if output_format: print "<br>"