def __exit__(self, exc_type, exc_value, tb):
    if self._previousContext:
        self._previousContext.makeCurrent()
def __exit__(self, exc_type, exc_value, tb):
    if self._previousContext:
        self._previousContext.makeCurrent()