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

Skip to content

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

Merged
merged 1 commit into from
Aug 30, 2014
Merged
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
2 changes: 1 addition & 1 deletion setupext.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Copy link
Member

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 ... ?

Copy link
Contributor Author

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.

Copy link
Member

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).

Copy link
Contributor Author

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.

version = self.version_from_header()

return self._check_for_pkg_config(
Expand Down