OMG did I just break standalone python usage of punyverse?

This commit is contained in:
Quantum 2013-10-30 22:52:19 -04:00
parent c3ec78ecce
commit a8bb6dfd34
2 changed files with 428 additions and 417 deletions

File diff suppressed because it is too large Load diff

View file

@ -257,14 +257,16 @@ cdef class WavefrontObject(object):
free(buf) free(buf)
fclose(cfile) fclose(cfile)
import sys model_base = None
if hasattr(sys, 'frozen'):
model_base = os.path.dirname(sys.executable)
else:
model_base = os.path.join(os.path.dirname(__file__), 'assets', 'models')
del sys
def load_model(path): def load_model(path):
global model_base
if model_base is None:
import sys
if hasattr(sys, 'frozen'):
model_base = os.path.dirname(sys.executable)
else:
model_base = os.path.join(os.path.dirname(__file__), 'assets', 'models')
if not os.path.isabs(path): if not os.path.isabs(path):
path = os.path.join(model_base, path) path = os.path.join(model_base, path)
if not isinstance(path, unicode): if not isinstance(path, unicode):