def poll(self):
    if self.popen:
        return (self.popen.poll() is None)
    else:
        return 0
def poll(self):
    if self.popen:
        return (self.popen.poll() is None)
    else:
        return 0