Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose Pillow package version as PIL.__version__ #2027

Merged
merged 1 commit into from Aug 6, 2016

Conversation

techtonik
Copy link
Contributor

@techtonik techtonik commented Jul 15, 2016

Fixes this:

>>> import PIL
>>> from PIL import ImageGrab
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/dist-packages/PIL/ImageGrab.py", line 22, in <module>
    raise ImportError("ImageGrab is OS X and Windows only")
ImportError: ImageGrab is OS X and Windows only
>>> PIL.version
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'version'
>>> PIL.__version__
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute '__version__'
>>> PIL.get_version()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'get_version'
>>> 

@radarhere
Copy link
Member

Just to check - there's no reason for importing ImageGrab in the middle, yes?

@techtonik
Copy link
Contributor Author

@radarhere yes, importing ImageGrab is just demonstration of the problem, which leads to version checking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants