From b082a6acec660d7c69bd8312ef764b29a4146b6d Mon Sep 17 00:00:00 2001 From: cncfanatics Date: Thu, 20 Jan 2011 22:40:55 +0100 Subject: [PATCH] Fix config pyfaPath handling --- config.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config.py b/config.py index 4b2d7c5ac..bc99c6c94 100644 --- a/config.py +++ b/config.py @@ -14,7 +14,8 @@ expansionVersion = "1.1.0" # The main pyfa directory which contains run.py # Python 2.X uses ANSI by default, so we need to convert the character encoding -pyfaPath = unicode(os.path.dirname(os.path.abspath(sys.modules['__main__'].__file__)), sys.getfilesystemencoding()) +if hasattr(sys.modules['__main__'], '__file__'): + pyfaPath = unicode(os.path.dirname(os.path.abspath(sys.modules['__main__'].__file__)), sys.getfilesystemencoding()) # Where we store the saved fits etc, default is the current users home directory savePath = unicode(os.path.expanduser(os.path.join("~", ".pyfa")), sys.getfilesystemencoding())