b) add a check so that this only happens when it's absolutely necessary (so if we're running on Mac OS and the platform is 32 bit, but not on any other platform).

 

This is how it is now, isn’t it? I have

 

if platform.system() == 'Darwin':

                                import locale

                                if locale.getlocale()[0] is None:

                                                locale.setlocale(locale.LC_ALL, 'en_US.UTF-8')

                                                

                                # On 32-bit OSX: Shortly init and destroy pygame window before all else

                                # Strangly, the experiment otherwise hangs at init_dispay() with pygame based backends...

                                if not sys.maxsize > 2**32:

                                                import pygame

                                                pygame.init()

                                                pygame.display.init()

                                                pygame.display.set_mode((10,10))

                                                pygame.quit()   

 

So first it is checked if one is running on OSX and the second once checks if the system is running in 32-bit. It should not have any effect on other OS’es.

 

From: Sebastiaan Mathot [mailto:notifications@github.com] 
Sent: vrijdag 17 mei 2013 11:01
To: smathot/OpenSesame
Cc: Daniel Schreij
Subject: Re: [OpenSesame] Fix to make OpenSesame function on OSX 32-bit (#167)

 

In opensesame:

> @@ -45,6 +45,15 @@ if __name__ == "__main__":
>              import locale
>              if locale.getlocale()[0] is None:
>                      locale.setlocale(locale.LC_ALL, 'en_US.UTF-8')
> +                    

Hmm, this is unfortunate.

I don't want to merge this patch into the OpenSesame master branch in this form, because initializing PyGame on all 32 bit systems goes against the idea of back-end independence. Is there a way that this can be done only at the moment that the experiment is started, or does it necessarily have to happen when the program is loaded? In the last case, I think we'll have to either a) keep this aside as a Mac-specific patch or b) add a check so that this only happens when it's absolutely necessary (so if we're running on Mac OS and the platform is 32 bit, but not on any other platform).

Also, a similar patch will need to be added to opensesamerun, of course.

—
Reply to this email directly or view it on GitHub <https://github.com/smathot/OpenSesame/pull/167/files#r4272306> .  <https://github.com/notifications/beacon/DZPa40xtoOXAtY4fpgxEdu5XPkdK0wPO1ibe_O8FyiHos7L9udWoekuSDGjA1J7R.gif>