# HG changeset patch # User Neil Muller # Date 1378655626 -7200 # Node ID 87c6ede3b10b2bec726908d3168b65121f192222 # Parent 30ae339d72249d5cd13d748d1590424112cf4fd2 Beware py2exe's rabbitholes, for they are windy and full of teeth (no-pyflakes for good measure) diff -r 30ae339d7224 -r 87c6ede3b10b nagslang/resources.py --- a/nagslang/resources.py Sun Sep 08 17:47:25 2013 +0200 +++ b/nagslang/resources.py Sun Sep 08 17:53:46 2013 +0200 @@ -1,7 +1,15 @@ import os import sys -from pkg_resources import resource_filename +try: + from pkg_resources import resource_filename +except ImportError: + # OK, we're most likely running under py2exe, so this is safe + # (for values of safe that are unconcerned about py2exe being involved) + def resource_filename(mod, path): + # There are better ways of doing this, but I've spent too much + # time going down this rabbithole already + return os.path.join(os.path.dirname(__file__), '..', 'data', path) import pygame