[Pythonmac-SIG] Re: PyGame weirdness on OS X, leaks & exceptions

Jerome jeremy.knope at gmail.com
Sun Aug 8 17:13:43 CEST 2004


oops, sent it to a single person again....

the problem is that when the python script calls pygame.display.init()
and then pygame.font.init() or whatever (seems to be display related)
it coughs up tons of Cocoa API errors like i pasted, but is fine if i
replace them with the general pygame.init
it's not that it's using code before it's inited, just seems to break
in OS X at least when doing such.  i'm trying to figure out where the
fault might be, think i should email the pygame guy too?
 --jerome



On Sun, 8 Aug 2004 11:55:25 +0200, Ronald Oussoren
<ronaldoussoren at mac.com> wrote:
>
> <quote>
>   pygame.init() -> passed, failed
>   Initialize all imported pygame modules. Including pygame modules that
> are not part of the base modules (like font and image).
>
>   It does not raise exceptions, but instead silently counts which
> modules have failed to init. The return argument contains a count of
> the number of modules initialized, and the number of modules that
> failed to initialize.
>
>   You can always initialize the modules you want by hand. The modules
> that need it have an init() and quit() routine built in, which you can
> call directly. They also have a get_init() routine which you can use to
> doublecheck the initialization. Note that the manual init() routines
> will raise an exception on error. Be aware that most platforms require
> the display module to be initialized before others. This init() will
> handle that for you, but if you initialize by hand, be aware of this
> constraint.
>
>   As with the manual init() routines. It is safe to call this init() as
> often as you like. If you have imported pygame modules since the.
> </quote>
>
> This seems to indicate you don't have to call pygame.init() but can
> initialize the submodules you want to use by hand. The order of
> initialization might cause problems.
>
> Ronald
> --
> X|support bv            http://www.xsupport.nl/
> T:  +31 610271479       F:  +31 204416173
>
>


More information about the Pythonmac-SIG mailing list