@@ -255,32 +255,7 @@ def main():
255255 excMsg = traceback .format_exc ()
256256 valid = checkIntegrity ()
257257
258- if valid is False :
259- errMsg = "code integrity check failed (turning off automatic issue creation). "
260- errMsg += "You should retrieve the latest development version from official GitHub "
261- errMsg += "repository at '%s'" % GIT_PAGE
262- logger .critical (errMsg )
263- print ()
264- dataToStdout (excMsg )
265- raise SystemExit
266-
267- elif any (_ in excMsg for _ in ("tamper/" , "waf/" )):
268- logger .critical (errMsg )
269- print ()
270- dataToStdout (excMsg )
271- raise SystemExit
272-
273- elif any (_ in excMsg for _ in ("ImportError" , "ModuleNotFoundError" , "Can't find file for module" )):
274- errMsg = "invalid runtime environment ('%s')" % excMsg .split ("Error: " )[- 1 ].strip ()
275- logger .critical (errMsg )
276- raise SystemExit
277-
278- elif all (_ in excMsg for _ in ("SyntaxError: Non-ASCII character" , ".py on line" , "but no encoding declared" )) or any (_ in excMsg for _ in ("source code string cannot contain null bytes" , "No module named" )):
279- errMsg = "invalid runtime environment ('%s')" % excMsg .split ("Error: " )[- 1 ].strip ()
280- logger .critical (errMsg )
281- raise SystemExit
282-
283- elif any (_ in excMsg for _ in ("MemoryError" , "Cannot allocate memory" )):
258+ if any (_ in excMsg for _ in ("MemoryError" , "Cannot allocate memory" )):
284259 errMsg = "memory exhaustion detected"
285260 logger .critical (errMsg )
286261 raise SystemExit
@@ -300,13 +275,6 @@ def main():
300275 logger .critical (errMsg )
301276 raise SystemExit
302277
303- elif all (_ in excMsg for _ in ("No such file" , "_'" )):
304- errMsg = "corrupted installation detected ('%s'). " % excMsg .strip ().split ('\n ' )[- 1 ]
305- errMsg += "You should retrieve the latest development version from official GitHub "
306- errMsg += "repository at '%s'" % GIT_PAGE
307- logger .critical (errMsg )
308- raise SystemExit
309-
310278 elif "Read-only file system" in excMsg :
311279 errMsg = "output device is mounted as read-only"
312280 logger .critical (errMsg )
@@ -373,13 +341,6 @@ def main():
373341 logger .critical (errMsg )
374342 raise SystemExit
375343
376- elif "'DictObject' object has no attribute '" in excMsg and all (_ in errMsg for _ in ("(fingerprinted)" , "(identified)" )):
377- errMsg = "there has been a problem in enumeration. "
378- errMsg += "Because of a considerable chance of false-positive case "
379- errMsg += "you are advised to rerun with switch '--flush-session'"
380- logger .critical (errMsg )
381- raise SystemExit
382-
383344 elif all (_ in excMsg for _ in ("pymysql" , "configparser" )):
384345 errMsg = "wrong initialization of pymsql detected (using Python3 dependencies)"
385346 logger .critical (errMsg )
@@ -391,17 +352,56 @@ def main():
391352 logger .critical (errMsg )
392353 raise SystemExit
393354
394- elif "bad marshal data (unknown type code)" in excMsg :
395- match = re .search (r"\s*(.+)\s+ValueError" , excMsg )
396- errMsg = "one of your .pyc files are corrupted%s" % (" ('%s')" % match .group (1 ) if match else "" )
397- errMsg += ". Please delete .pyc files on your system to fix the problem"
355+ elif kb .get ("dumpKeyboardInterrupt" ):
356+ raise SystemExit
357+
358+ elif any (_ in excMsg for _ in ("Broken pipe" ,)):
359+ raise SystemExit
360+
361+ elif valid is False :
362+ errMsg = "code integrity check failed (turning off automatic issue creation). "
363+ errMsg += "You should retrieve the latest development version from official GitHub "
364+ errMsg += "repository at '%s'" % GIT_PAGE
398365 logger .critical (errMsg )
366+ print ()
367+ dataToStdout (excMsg )
399368 raise SystemExit
400369
401- elif kb .get ("dumpKeyboardInterrupt" ):
370+ elif any (_ in excMsg for _ in ("tamper/" , "waf/" )):
371+ logger .critical (errMsg )
372+ print ()
373+ dataToStdout (excMsg )
402374 raise SystemExit
403375
404- elif any (_ in excMsg for _ in ("Broken pipe" ,)):
376+ elif any (_ in excMsg for _ in ("ImportError" , "ModuleNotFoundError" , "Can't find file for module" )):
377+ errMsg = "invalid runtime environment ('%s')" % excMsg .split ("Error: " )[- 1 ].strip ()
378+ logger .critical (errMsg )
379+ raise SystemExit
380+
381+ elif all (_ in excMsg for _ in ("SyntaxError: Non-ASCII character" , ".py on line" , "but no encoding declared" )) or any (_ in excMsg for _ in ("source code string cannot contain null bytes" , "No module named" )):
382+ errMsg = "invalid runtime environment ('%s')" % excMsg .split ("Error: " )[- 1 ].strip ()
383+ logger .critical (errMsg )
384+ raise SystemExit
385+
386+ elif all (_ in excMsg for _ in ("No such file" , "_'" )):
387+ errMsg = "corrupted installation detected ('%s'). " % excMsg .strip ().split ('\n ' )[- 1 ]
388+ errMsg += "You should retrieve the latest development version from official GitHub "
389+ errMsg += "repository at '%s'" % GIT_PAGE
390+ logger .critical (errMsg )
391+ raise SystemExit
392+
393+ elif "'DictObject' object has no attribute '" in excMsg and all (_ in errMsg for _ in ("(fingerprinted)" , "(identified)" )):
394+ errMsg = "there has been a problem in enumeration. "
395+ errMsg += "Because of a considerable chance of false-positive case "
396+ errMsg += "you are advised to rerun with switch '--flush-session'"
397+ logger .critical (errMsg )
398+ raise SystemExit
399+
400+ elif "bad marshal data (unknown type code)" in excMsg :
401+ match = re .search (r"\s*(.+)\s+ValueError" , excMsg )
402+ errMsg = "one of your .pyc files are corrupted%s" % (" ('%s')" % match .group (1 ) if match else "" )
403+ errMsg += ". Please delete .pyc files on your system to fix the problem"
404+ logger .critical (errMsg )
405405 raise SystemExit
406406
407407 for match in re .finditer (r'File "(.+?)", line' , excMsg ):
0 commit comments