Skip: CFFI imports pycparser which doesn't support PYTHONOPTIMIZE=2

This commit is contained in:
Hugo 2018-07-04 18:26:09 +03:00
parent 4218a769d7
commit 663b06e223

View File

@ -1,16 +1,21 @@
from helper import unittest, PillowTestCase, hopper, on_appveyor
try:
from PIL import PyAccess
import cffi
except ImportError:
cffi = None
pass
from PIL import Image
import sys
import os
# CFFI imports pycparser which doesn't support PYTHONOPTIMIZE=2
# https://github.com/eliben/pycparser/pull/198#issuecomment-317001670
if os.environ.get("PYTHONOPTIMIZE") == "2":
cffi = None
else:
try:
from PIL import PyAccess
import cffi
except ImportError:
cffi = None
pass
class AccessTest(PillowTestCase):
# initial value