Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Tests/test_pyroma.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from helper import unittest, PillowTestCase

from PIL import PILLOW_VERSION
from PIL import __version__

try:
import pyroma
Expand All @@ -26,7 +26,7 @@ def test_pyroma(self):
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, [
Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@
#
# 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.
Expand Down
17 changes: 17 additions & 0 deletions docs/releasenotes/5.2.0.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
5.2.0
-----

API Changes
===========

Deprecations
^^^^^^^^^^^^

These version constants have been deprecated. ``VERSION`` will be removed in
Pillow 6.0.0, and ``PILLOW_VERSION`` will be removed after that.

* ``PIL.VERSION`` (old PIL version 1.1.7)
* ``PIL.PILLOW_VERSION``
* ``PIL.Image.VERSION``
* ``PIL.Image.PILLOW_VERSION``

Use ``PIL.__version__`` instead.


API Additions
=============

Expand Down
2 changes: 1 addition & 1 deletion selftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def testimage():
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__))
Expand Down
9 changes: 6 additions & 3 deletions src/PIL/Image.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@
# See the README file for information on usage and redistribution.
#

from . import VERSION, PILLOW_VERSION, _plugins
# VERSION is deprecated and will be removed in Pillow 6.0.0.
# PILLOW_VERSION is deprecated and will be removed after that.
# Use __version__ instead.
from . import VERSION, PILLOW_VERSION, __version__, _plugins
from ._util import py3

import logging
Expand Down Expand Up @@ -59,13 +62,13 @@ def __getattr__(self, id):
# 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()
Expand Down
3 changes: 3 additions & 0 deletions src/PIL/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@

from . import _version

# VERSION is deprecated and will be removed in Pillow 6.0.0.
# PILLOW_VERSION is deprecated and will be removed after that.
# Use __version__ instead.
VERSION = '1.1.7' # PIL Version
PILLOW_VERSION = __version__ = _version.__version__

Expand Down