diff --git a/pwnlib/elf/corefile.py b/pwnlib/elf/corefile.py index e92034e62..229cff7f5 100644 --- a/pwnlib/elf/corefile.py +++ b/pwnlib/elf/corefile.py @@ -1162,7 +1162,10 @@ def __init__(self, proc): new_path = 'core.%i' % core_pid if core_pid > 0 and new_path != self.core_path: write(new_path, self.read(self.core_path)) - self.unlink(self.core_path) + try: + self.unlink(self.core_path) + except (IOError, OSError): + log.warn("Could not delete %r" % self.core_path) self.core_path = new_path # Check the PID