Closed bwoodsend closed 1 year ago
So you need to click into the reported error file. Replace this code:
if tuple(PILversion) < (6, 2, 1): with this code:
if tuple(map(int, PILversion.split("."))) < (6, 2, 1):
hey @bwoodsend thanks for your fix! Can we get this merged and release a new pyscreeze version? let me know if I can help in any way
if tuple(map(int, PILversion.split("."))) < (6, 2, 1):
I think similar to this one was already merged, but don't get why we convert to tuple instead comparing pil version string with '6.2.1'
instead (6, 2, 1)
Indeed, the fix slipped into https://github.com/asweigart/pyscreeze/commit/eeca245a135cf171c163b3691300138518efa64e.
but don't get why we convert to tuple instead comparing pil version string with '6.2.1' instead (6, 2, 1)
If you mean why doesn't it use PIL.__version__ >= "6.2.1"
then the answer is because it gives the wrong answer whenever any of the version parts reaches a power of 10:
>>> "6.10.0" >= "6.2.1"
False
dbe9cb89 introduced a version check using
PIL.__version__
assuming that that attribute is a int-tuple whereas it's really just a string, leading to a type error on even the most basic usage on macOS:Convert the offending version string to an int-tuple.