@@ -36,14 +36,14 @@ def smokeTest():
3636 retVal = True
3737 count , length = 0 , 0
3838
39- for root , _ , files in os .walk (paths .SQLMAP_ROOT_PATH ):
40- for file in files :
39+ for _ , _ , files in os .walk (paths .SQLMAP_ROOT_PATH ):
40+ for ifile in files :
4141 length += 1
4242
4343 for root , _ , files in os .walk (paths .SQLMAP_ROOT_PATH ):
44- for file in files :
45- if os .path .splitext (file )[1 ].lower () == '.py' and file != '__init__.py' :
46- path = os .path .join (root , os .path .splitext (file )[0 ])
44+ for ifile in files :
45+ if os .path .splitext (ifile )[1 ].lower () == '.py' and ifile != '__init__.py' :
46+ path = os .path .join (root , os .path .splitext (ifile )[0 ])
4747 path = path .replace (paths .SQLMAP_ROOT_PATH , '.' )
4848 path = path .replace (os .sep , '.' ).lstrip ('.' )
4949 try :
@@ -52,7 +52,7 @@ def smokeTest():
5252 except Exception , msg :
5353 retVal = False
5454 dataToStdout ("\r " )
55- errMsg = "smoke test failed at importing module '%s' (%s):\n %s" % (path , os .path .join (paths .SQLMAP_ROOT_PATH , file ), msg )
55+ errMsg = "smoke test failed at importing module '%s' (%s):\n %s" % (path , os .path .join (paths .SQLMAP_ROOT_PATH , ifile ), msg )
5656 logger .error (errMsg )
5757 else :
5858 # Run doc tests
@@ -62,7 +62,7 @@ def smokeTest():
6262 retVal = False
6363
6464 count += 1
65- status = '%d/%d (%d%s)' % (count , length , round (100.0 * count / length ), '%' )
65+ status = '%d/%d (%d%s) ' % (count , length , round (100.0 * count / length ), '%' )
6666 dataToStdout ("\r [%s] [INFO] complete: %s" % (time .strftime ("%X" ), status ))
6767
6868 dataToStdout ("\r %s\r " % (" " * (getConsoleWidth ()- 1 )))
@@ -189,9 +189,9 @@ def runCase(name=None, switches=None, log=None, session=None):
189189 retVal = False
190190
191191 if session and retVal :
192- file = open (conf .sessionFile , 'r' )
193- content = file .read ()
194- file .close ()
192+ ifile = open (conf .sessionFile , 'r' )
193+ content = ifile .read ()
194+ ifile .close ()
195195 for item in session :
196196 if item .startswith ("r'" ) and item .endswith ("'" ):
197197 if not re .search (item [2 :- 1 ], content ):
@@ -202,9 +202,9 @@ def runCase(name=None, switches=None, log=None, session=None):
202202 break
203203
204204 if log and retVal :
205- file = open (conf .dumper .getOutputFile (), 'r' )
206- content = file .read ()
207- file .close ()
205+ ifile = open (conf .dumper .getOutputFile (), 'r' )
206+ content = ifile .read ()
207+ ifile .close ()
208208 for item in log :
209209 if item .startswith ("r'" ) and item .endswith ("'" ):
210210 if not re .search (item [2 :- 1 ], content ):
0 commit comments