mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-01 01:07:51 -04:00
minor fixes to reduce startup noise
This commit is contained in:
parent
5289285624
commit
c4e79695e9
@ -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());
|
||||
|
@ -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).
|
||||
|
Loading…
x
Reference in New Issue
Block a user