minor fixes to reduce startup noise

This commit is contained in:
David Rose 2009-08-20 15:46:31 +00:00
parent 5289285624
commit c4e79695e9
2 changed files with 13 additions and 1 deletions

View File

@ -42,6 +42,16 @@ P3DPythonRun(int argc, char *argv[]) {
_py_argv[0] = argv[0];
_py_argv[1] = NULL;
#ifdef NDEBUG
// In OPTIMIZE 4 compilation mode, run Python in optimized mode too.
extern int Py_OptimizeFlag;
Py_OptimizeFlag = 2;
#endif
// Turn off the automatic load of site.py at startup.
extern int Py_NoSiteFlag;
Py_NoSiteFlag = 1;
// Initialize Python. It appears to be important to do this before
// we open the pipe streams and spawn the thread, below.
Py_SetProgramName((char *)_program_name.c_str());

View File

@ -158,7 +158,9 @@ class AppRunner(DirectObject):
# vfs right now; careless application code can still write
# to these directories inadvertently.
for dirname in sys.path:
vfs.mount(dirname, dirname, vfs.MFReadOnly)
dirname = Filename.fromOsSpecific(dirname)
if dirname.isDirectory():
vfs.mount(dirname, dirname, vfs.MFReadOnly)
# Also mount some standard directories read-write
# (temporary and app-data directories).