def _set_preview_window(self, value):
    self._check_camera_open()
    warnings.warn(PiCameraDeprecated('PiCamera.preview_window is deprecated; use PiCamera.preview.window instead'))
    if self.preview:
        self.preview.window = value
    else:
        self._preview_window = value
def _set_preview_window(self, value):
    self._check_camera_open()
    warnings.warn(PiCameraDeprecated('PiCamera.preview_window is deprecated; use PiCamera.preview.window instead'))
    if self.preview:
        self.preview.window = value
    else:
        self._preview_window = value