better web2py.py thanks Niphlod

This commit is contained in:
mdipierro
2012-08-20 16:02:11 -05:00
parent 7898e4aac3
commit c7074d5e4d
3 changed files with 8 additions and 6 deletions
+6 -4
View File
@@ -4,11 +4,13 @@
import os
import sys
if getattr(sys, 'frozen', None):
path = os.getcwd() # Seems necessary for py2exe
else:
if '__file__' in globals():
path = os.path.dirname(os.path.abspath(__file__))
os.chdir(path)
elif hasattr(sys, 'frozen'):
path = os.path.dirname(os.path.abspath(sys.executable)) # for py2exe
else: #should never happen
path = os.getcwd()
os.chdir(path)
sys.path = [path]+[p for p in sys.path if not p==path]