summaryrefslogtreecommitdiffstats
path: root/Python/sysmodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/sysmodule.c')
-rw-r--r--Python/sysmodule.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index 46a6aa9..d238561 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -801,6 +801,10 @@ sys_getwindowsversion(PyObject *self)
PyStructSequence_SET_ITEM(version, pos++, PyLong_FromLong(ver.wSuiteMask));
PyStructSequence_SET_ITEM(version, pos++, PyLong_FromLong(ver.wProductType));
+ if (PyErr_Occurred()) {
+ Py_DECREF(version);
+ return NULL;
+ }
return version;
}