mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-07-11 00:32:27 +03:00
Merge pull request #4694 from nulano/pyaccess-docs
Fix PyAccess docs using deferred_error
This commit is contained in:
commit
58c527d525
|
@ -23,11 +23,9 @@
|
||||||
import logging
|
import logging
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
try:
|
||||||
from cffi import FFI
|
from cffi import FFI
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
|
||||||
|
|
||||||
|
|
||||||
defs = """
|
defs = """
|
||||||
struct Pixel_RGBA {
|
struct Pixel_RGBA {
|
||||||
unsigned char r,g,b,a;
|
unsigned char r,g,b,a;
|
||||||
|
@ -38,6 +36,14 @@ struct Pixel_I16 {
|
||||||
"""
|
"""
|
||||||
ffi = FFI()
|
ffi = FFI()
|
||||||
ffi.cdef(defs)
|
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:
|
class PyAccess:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user