def _get_preview_layer(self):
    self._check_camera_open()
    warnings.warn(PiCameraDeprecated('PiCamera.preview_layer is deprecated; use PiCamera.preview.layer instead'))
    if self.preview:
        return self.preview.layer
    else:
        return self._preview_layer
def _get_preview_layer(self):
    self._check_camera_open()
    warnings.warn(PiCameraDeprecated('PiCamera.preview_layer is deprecated; use PiCamera.preview.layer instead'))
    if self.preview:
        return self.preview.layer
    else:
        return self._preview_layer