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())