def _get_preview_window(self):
    self._check_camera_open()
    warnings.warn(PiCameraDeprecated('PiCamera.preview_window is deprecated; use PiCamera.preview.window instead'))
    if self.preview:
        return self.preview.window
    else:
        return self._preview_window
def _get_preview_window(self):
    self._check_camera_open()
    warnings.warn(PiCameraDeprecated('PiCamera.preview_window is deprecated; use PiCamera.preview.window instead'))
    if self.preview:
        return self.preview.window
    else:
        return self._preview_window