from subprocess import Popen class Spam (Popen): def poll (self): print "now polling" return Popen.poll (self) t = Spam (["echo", "eggs"]) del t