some freezers publish also __file__ in globals()
This commit is contained in:
1 parent
274634a71a
commit
98f245655b
2 files changed
+6
-6
No files matched your search
@@ -5,10 +5,10 @@ import sys
|
||||
import os
|
||||
import optparse
|
||||
|
||||
if '__file__' in globals():
|
||||
path = os.path.dirname(os.path.abspath(__file__))
|
||||
elif hasattr(sys, 'frozen'):
|
||||
if hasattr(sys, 'frozen'):
|
||||
path = os.path.dirname(os.path.abspath(sys.executable))
|
||||
elif '__file__' in globals():
|
||||
path = os.path.dirname(os.path.abspath(__file__))
|
||||
else:
|
||||
path = os.getcwd()
|
||||
os.chdir(path)
|
||||
|
||||
Reference in new issue
Block a user