Anonymous avatar Anonymous committed d8b2e71

Ignore error if default icon not found.

Comments (0)

Files changed (2)

  - Fixed unset colorkey with Surface.set_colorkey
  - Performance of simple (non error-checking) SDL/pygame functions improved
  - Software blitting BGR surfaces corrected.
+ - Ignore error if default icon not found.
 
 Pygame-ctypes 0.09
 ------------------

pygame/display.py

 
     if sys.platform != 'darwin':
         if not _icon_was_set:
-            file = pygame.pkgdata.getResource(_icon_defaultname)
-            iconsurf = pygame.image.load(file)
-            SDL_SetColorKey(iconsurf._surf, SDL_SRCCOLORKEY, 0)
-            set_icon(iconsurf)
+            try:	
+                file = pygame.pkgdata.getResource(_icon_defaultname)
+                iconsurf = pygame.image.load(file)
+                SDL_SetColorKey(iconsurf._surf, SDL_SRCCOLORKEY, 0)
+                set_icon(iconsurf)
+            except IOError:
+                # Not worth dying over.
+                pass
 
     return _display_surface
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.