mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-24 17:06:16 +03:00
Prefer more conventional __version__ rather than PILLOW_VERSION
This commit is contained in:
parent
0c438db926
commit
e33dd498f5
|
@ -1,6 +1,6 @@
|
|||
from helper import unittest, PillowTestCase
|
||||
|
||||
from PIL import PILLOW_VERSION
|
||||
from PIL import __version__
|
||||
|
||||
try:
|
||||
import pyroma
|
||||
|
@ -26,7 +26,7 @@ class TestPyroma(PillowTestCase):
|
|||
rating = pyroma.ratings.rate(data)
|
||||
|
||||
# Assert
|
||||
if 'rc' in PILLOW_VERSION:
|
||||
if 'rc' in __version__:
|
||||
# Pyroma needs to chill about RC versions
|
||||
# and not kill all our tests.
|
||||
self.assertEqual(rating, (9, [
|
||||
|
|
|
@ -53,9 +53,9 @@ author = u'Fredrik Lundh, Alex Clark and Contributors'
|
|||
#
|
||||
# The short X.Y version.
|
||||
import PIL
|
||||
version = PIL.PILLOW_VERSION
|
||||
version = PIL.__version__
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
release = PIL.PILLOW_VERSION
|
||||
release = PIL.__version__
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
|
|
|
@ -161,7 +161,7 @@ if __name__ == "__main__":
|
|||
exit_status = 0
|
||||
|
||||
print("-"*68)
|
||||
print("Pillow", Image.PILLOW_VERSION, "TEST SUMMARY ")
|
||||
print("Pillow", Image.__version__, "TEST SUMMARY ")
|
||||
print("-"*68)
|
||||
print("Python modules loaded from", os.path.dirname(Image.__file__))
|
||||
print("Binary modules loaded from", os.path.dirname(Image.core.__file__))
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
# See the README file for information on usage and redistribution.
|
||||
#
|
||||
|
||||
from . import VERSION, PILLOW_VERSION, _plugins
|
||||
from . import VERSION, PILLOW_VERSION, __version__, _plugins
|
||||
from ._util import py3
|
||||
|
||||
import logging
|
||||
|
@ -59,13 +59,13 @@ try:
|
|||
# Also note that Image.core is not a publicly documented interface,
|
||||
# and should be considered private and subject to change.
|
||||
from . import _imaging as core
|
||||
if PILLOW_VERSION != getattr(core, 'PILLOW_VERSION', None):
|
||||
if __version__ != getattr(core, 'PILLOW_VERSION', None):
|
||||
raise ImportError("The _imaging extension was built for another "
|
||||
"version of Pillow or PIL:\n"
|
||||
"Core version: %s\n"
|
||||
"Pillow version: %s" %
|
||||
(getattr(core, 'PILLOW_VERSION', None),
|
||||
PILLOW_VERSION))
|
||||
__version__))
|
||||
|
||||
except ImportError as v:
|
||||
core = _imaging_not_installed()
|
||||
|
|
|
@ -951,5 +951,5 @@ def versions():
|
|||
|
||||
return (
|
||||
VERSION, core.littlecms_version,
|
||||
sys.version.split()[0], Image.VERSION
|
||||
sys.version.split()[0], Image.__version__
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue
Block a user