8000 Remove 'import pygame._view' in packager_imports. by Starbuck5 · Pull Request #2384 · pygame/pygame · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Remove 'import pygame._view' in packager_imports. #2384

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
Dec 7, 2020
Merged

Conversation

Starbuck5
Copy link
Contributor
@Starbuck5 Starbuck5 commented Dec 6, 2020

Super minor change.

This is spurred by me removing the old pygame hook on the pyinstaller repo.
Since pygame._view doesn't seem to exist anymore, this line doesn't need to exist. (trying to import it throws a ModuleNotFound)

Edit: ugh this doesn't need to run CI, but I don't know how to stop it once it starts.

Super minor change.

This is spurred by me removing the old pygame hook on the pyinstaller repo.
Since pygame._view doesn't seem to exist anymore, this line doesn't need to exist. (trying to import it throws a ModuleNotFound)
Copy link
Contributor
@ankith26 ankith26 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice cleanup :)
Since pygame._view does not exist anymore, we must not be importing it.
Thanks 👍

CI has failed due to some random issue that occasionally happens, not related to this PR.
BTW. The function we are cleaning up does not get called anywhere. It has been in that state since years. And no one complained about the error that it gives while importing pygame._view.
Maybe remove the function as well (unless it is serving a purpose I am not aware of)

@Starbuck5
Copy link
Contributor Author

The function just exists so that programs that freeze python code into executables will see those specific imports.

This is a more general solution than a hook, because it works for things other than pyinstaller: like py2app/py2exe, as mentioned in the function comment.

Now that pygame doesn't have any _view module that needs to be seen by these programs, this statement can be removed.

@ankith26
Copy link
Contributor
ankith26 commented Dec 6, 2020

I did search the Internet for the usage of this packager_imports function. And i didn’t find any meaningful info.
Probably it’s an obsoleted feature of py2app/py2exe

@Starbuck5
Copy link
8000 Contributor Author

The packager imports function was never supposed to be run. It exists so that programs parsing the code for dependencies can see that “it imports x” without the program actually importing x.

@ankith26
Copy link
Contributor
ankith26 commented Dec 7, 2020

hmm yeah you are right. I just got a bit confused

Copy link
Member
@illume illume left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 thanks

@illume illume merged commit 17dc146 into main Dec 7, 2020
@illume illume deleted the Starbuck5-patch-1 branch December 7, 2020 20:12
@illume illume added this to the 2.0.1 milestone Aug 21, 2021
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.

3 participants
0