[Pythonmac-SIG] [pygame][py2app] strange behaviour with mixer.music

Pierre-Alain Dorange pdorange at mac.com
Sat Jul 5 13:34:32 CEST 2008


note : fu2 gmane.comp.python.pygame

I currently develop my first small game with python on MacOS X.

i add a background music and it works fine with python interpreted.

Bu now when a build my bundle (with py2app), it bundle broke when
loading the music with a strange error message.

The source code :
        import os, pygame
        from pygame.locals import *

        pygame.init()

        [...]

        pygame.mixer.music.load(fname)
        pygame.mixer.music.set_volume(pref.musicvolume)
        pygame.mixer.music.play(-1)

Works interpreted.
Broke when bundled with py2app :

File
"/Volumes/Documents/PAD/Dev/PyGame/MicroWar/Source/dist/MicroWar.app/Con
tents/Resources/microwar.py", line 1721, in main
    pygame.mixer.music.load(fname)
AttributeError: 'module' object has no attribute 'music'
2008-07-05 13:30:40.741 MicroWar[918] MicroWar Error
2008-07-05 13:30:40.741 MicroWar[918] MicroWar Error
An unexpected error has occurred during execution of the main script

AttributeError: 'module' object has no attribute 'music'




More information about the Pythonmac-SIG mailing list