'Stop the Xephyr instance'

def stop_xephyr(self):

    if (self.proc is None):
        return
    if (self.proc.poll() is None):
        self.proc.terminate()
    self.proc.wait()
    self.proc = None
