Closed GoogleCodeExporter closed 9 years ago
I use pefile to detect a list of pe file,but when pefile raise
PEFormatError,the script will exit.but I only want pefile to skip the bad
format pe file.
Original comment by whiled...@gmail.com
on 10 Dec 2010 at 11:09
That's the intended behavior. The PEFormatError exception is raised to indicate
problems parsing the file.
You can achieve the result you seek by simply catching the exception in your
script, for instance:
try:
pe = pefile.PE('/path/to/executable')
except pefile.PEFormatError:
pass
That will catch the exceptions and do nothing about it.
Original comment by ero.carr...@gmail.com
on 10 Dec 2010 at 3:39
Original issue reported on code.google.com by
whiled...@gmail.com
on 10 Dec 2010 at 11:07