-
-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Fixes TypeError when installing without freetype #3414
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
Conversation
@@ -937,7 +937,7 @@ def check(self): | |||
|
|||
# Early versions of freetype grep badly inside freetype-config, | |||
# so catch those cases. (tested with 2.5.3). | |||
if 'No such file or directory\ngrep:' in version: | |||
if version is None or 'No such file or directory\ngrep:' in version: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be if version is not None and ...
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, this is what I meant. The next line gets version
another way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not obvious to me that what ever makes the call fail should be handled the same as the case this if statement is supposed to catch (where the call succeeds (returns 0), but does not work).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Original pull request: #3363.
I think handling an invalid return value (the text "No such file or directory...") the same as an error code (status != 0
) from freetype-config makes sense. The original PR really works around the fact that freetype-config exits with 0 on error here.
@pelson Can you take a look at this? |
and @matthew-brett |
I ran into this exact issue moments ago. Applied the given pull request to the current |
👍 - thanks for this. |
Fixes TypeError when installing without freetype
When
freetype-config
is missing, setup.py crashes with TypeError. This fixes it and allows the "required packages" info to be printed.Log of the error installing 1.4.0: