mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-12 18:26:17 +03:00
selftests pass with namespaces on py2.7/3.2
This commit is contained in:
parent
517e0210ab
commit
7f178bc0b6
13
selftest.py
13
selftest.py
|
@ -3,13 +3,24 @@ from __future__ import print_function
|
|||
ROOT = "."
|
||||
|
||||
import os, sys
|
||||
sys.path.insert(0, ROOT)
|
||||
|
||||
# Path silliness. This selftest needs to be able to import itself, so
|
||||
#it needs . in the path. However, since the compiled versions of the
|
||||
#PIL bits are not in PIL, they're in dist, or build, or actually
|
||||
#installed. In fact, importing from ./PIL is going to fail on any
|
||||
#.c/so item. So. We remove it from the path, import all the PIL stuff
|
||||
#from elsewhere, then pop the current directory back on the path so
|
||||
#that we can import this and run the doctest
|
||||
|
||||
del(sys.path[0])
|
||||
|
||||
from PIL import Image
|
||||
from PIL import ImageDraw
|
||||
from PIL import ImageFilter
|
||||
from PIL import ImageMath
|
||||
|
||||
sys.path.insert(0,ROOT)
|
||||
|
||||
try:
|
||||
Image.core.ping
|
||||
except ImportError as v:
|
||||
|
|
Loading…
Reference in New Issue
Block a user