def attach(self, canvas):
        if self.canvas is not None:
            self.detach()
        if not self.config.compatible(canvas):
            raise RuntimeError('Cannot attach %r to %r' % (canvas, self))
        self.canvas = canvas
dataset/ETHPy150Open ardekantur/pyglet/pyglet/gl/base.py/Context.attach/original