From c4e79695e9979d278f2b026dae9a6cc6da0951e2 Mon Sep 17 00:00:00 2001 From: David Rose Date: Thu, 20 Aug 2009 15:46:31 +0000 Subject: [PATCH] minor fixes to reduce startup noise --- direct/src/plugin/p3dPythonRun.cxx | 10 ++++++++++ direct/src/showutil/runp3d.py | 4 +++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/direct/src/plugin/p3dPythonRun.cxx b/direct/src/plugin/p3dPythonRun.cxx index f09872b047..009cf3801d 100755 --- a/direct/src/plugin/p3dPythonRun.cxx +++ b/direct/src/plugin/p3dPythonRun.cxx @@ -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()); diff --git a/direct/src/showutil/runp3d.py b/direct/src/showutil/runp3d.py index 44b99e3796..089f95922d 100755 --- a/direct/src/showutil/runp3d.py +++ b/direct/src/showutil/runp3d.py @@ -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).