fix PyAccess docs using deferred_error

This commit is contained in:
nulano 2020-06-14 08:35:55 +02:00
parent 41a75210b5
commit 7119ef54fb

View File

@ -23,11 +23,9 @@
import logging
import sys
try:
from cffi import FFI
logger = logging.getLogger(__name__)
defs = """
struct Pixel_RGBA {
unsigned char r,g,b,a;
@ -38,6 +36,14 @@ struct Pixel_I16 {
"""
ffi = FFI()
ffi.cdef(defs)
except ImportError as ex:
# Allow error import for doc purposes, but error out when accessing
# anything in core.
from ._util import deferred_error
FFI = ffi = deferred_error(ex)
logger = logging.getLogger(__name__)
class PyAccess: