Skip to content

Conversation

yunline
Copy link
Contributor

@yunline yunline commented Feb 19, 2023

Issue: #1845

@yunline yunline requested a review from a team as a code owner February 19, 2023 12:42
Copy link
Member

@oddbookworm oddbookworm left a comment

Choose a reason for hiding this comment

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

In my testing, this worked great. getattr(pygame, "IS_CE", False) returned True. I think docs should be added for this feature however, which is the reason for the change request. Probably best to document it in https://github.com/pygame-community/pygame-ce/blob/main/docs/reST/ref/pygame.rst IMO

@MyreMylar
Copy link
Member

This also seems to be crashing the CI in the sphinx docs.

Perhaps we could just do a:

DEC_CONSTS(IS_CE, 1);

instead?

@yunline
Copy link
Contributor Author

yunline commented Feb 20, 2023

This also seems to be crashing the CI in the sphinx docs.

Perhaps we could just do a:

DEC_CONSTS(IS_CE, 1);

instead?

I doubt if the crash was caused by IS_CE.
And IS_CE should be a bool but DEC_CONSTS genetates an integer constant.
Well, You are right.

Copy link
Member

@MyreMylar MyreMylar left a comment

Choose a reason for hiding this comment

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

Tested with:

import pygame


if getattr(pygame, "IS_CE", False):
    print("Running pygame CE")
else:
    print("Not running pygame CE")

And it works as it should.

Copy link
Member

@oddbookworm oddbookworm left a comment

Choose a reason for hiding this comment

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

LGTM!

@oddbookworm oddbookworm added this to the 2.1.4 milestone Feb 20, 2023
@oddbookworm oddbookworm merged commit 8549d1c into pygame-community:main Feb 20, 2023
@yunline yunline deleted the IS_CE branch February 21, 2023 10:17
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.

A way to detect whether Pygame-CE is being used.
3 participants