summaryrefslogtreecommitdiff
path: root/Python/pythonrun.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/pythonrun.c')
-rw-r--r--Python/pythonrun.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index ec2c6caea3..252b2d171b 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -264,6 +264,9 @@ Py_InitializeEx(int install_sigs)
_PyImportHooks_Init();
+ /* Initialize _warnings. */
+ _PyWarnings_Init();
+
#if defined(HAVE_LANGINFO_H) && defined(CODESET)
/* On Unix, set the file system encoding according to the
user's preference, if the CODESET names a well-known
@@ -284,7 +287,6 @@ Py_InitializeEx(int install_sigs)
initsigs(); /* Signal handling stuff, including initintr() */
/* Initialize warnings. */
- _PyWarnings_Init();
if (PySys_HasWarnOptions()) {
PyObject *warnings_module = PyImport_ImportModule("warnings");
if (!warnings_module)