summaryrefslogtreecommitdiffstats
path: root/Python/pythonrun.c
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2002-12-30 22:29:22 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2002-12-30 22:29:22 (GMT)
commitc91ed400e053dc9f11dd30c84e2bb611999dce50 (patch)
treef190a1d4d9d3dbdb7d60afda9f7ea643e4f63b1b /Python/pythonrun.c
parent83f898c86c5ce68eaddd8f729a67ae2d7d0666ec (diff)
downloadcpython-c91ed400e053dc9f11dd30c84e2bb611999dce50.zip
cpython-c91ed400e053dc9f11dd30c84e2bb611999dce50.tar.gz
cpython-c91ed400e053dc9f11dd30c84e2bb611999dce50.tar.bz2
SF #561244, Micro optimizations
Initialize the small integers and __builtins__ in startup. This removes some if conditions. Change XDECREF to DECREF for values which shouldn't be NULL.
Diffstat (limited to 'Python/pythonrun.c')
-rw-r--r--Python/pythonrun.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index 7469cb8..81543cc 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -124,6 +124,12 @@ Py_Initialize(void)
_Py_ReadyTypes();
+ if (!PyFrame_Init())
+ Py_FatalError("Py_Initialize: can't init frames");
+
+ if (!PyInt_Init())
+ Py_FatalError("Py_Initialize: can't init ints");
+
interp->modules = PyDict_New();
if (interp->modules == NULL)
Py_FatalError("Py_Initialize: can't make modules dictionary");