equal
deleted
inserted
replaced
925 The code supports py2exe (most common, Windows only) and tools/freeze |
925 The code supports py2exe (most common, Windows only) and tools/freeze |
926 (portable, not much used). |
926 (portable, not much used). |
927 """ |
927 """ |
928 return (safehasattr(sys, "frozen") or # new py2exe |
928 return (safehasattr(sys, "frozen") or # new py2exe |
929 safehasattr(sys, "importers") or # old py2exe |
929 safehasattr(sys, "importers") or # old py2exe |
930 imp.is_frozen("__main__")) # tools/freeze |
930 imp.is_frozen(u"__main__")) # tools/freeze |
931 |
931 |
932 # the location of data files matching the source code |
932 # the location of data files matching the source code |
933 if mainfrozen() and getattr(sys, 'frozen', None) != 'macosx_app': |
933 if mainfrozen() and getattr(sys, 'frozen', None) != 'macosx_app': |
934 # executable version (py2exe) doesn't support __file__ |
934 # executable version (py2exe) doesn't support __file__ |
935 datapath = os.path.dirname(sys.executable) |
935 datapath = os.path.dirname(sys.executable) |