diff --git a/Tools/scripts/deepfreeze.py b/Tools/scripts/deepfreeze.py index db44ba89c67..080980f6d0a 100644 --- a/Tools/scripts/deepfreeze.py +++ b/Tools/scripts/deepfreeze.py @@ -406,7 +406,7 @@ PyObject * _Py_get_%%NAME%%_toplevel(void) { %%NAME%%_do_patchups(); - return (PyObject *) &%%NAME%%_toplevel; + return Py_NewRef((PyObject *) &%%NAME%%_toplevel); } """