According to:
https://docs.python.org/3/library/subprocess.html#subprocess.Popen.poll
poll can return None if the process hasn't terminated.
I'm not quite sure how addr2line could end up closing the pipe without
terminating but we did see this happen on one of our bots:
<...>scripts/asan_symbolize.py", line 211, in symbolize logging.debug("addr2line exited early (broken pipe), returncode=%d" % self.pipe.poll()) TypeError: %d format: a number is required, not NoneType
Handle None by printing a message that we couldn't get the return
code.
You don't need to do string interpolation here. You can just do
even better yet
which shouldn't care if self.pipe.poll() is not an integer.
I'm not sure if we've adopted python3 in this file yet but if we have then we could also do