Commit 5bd2af9 1 parent 4ffc569 commit 5bd2af9 Copy full SHA for 5bd2af9
File tree 1 file changed +21
-10
lines changed
1 file changed +21
-10
lines changed Original file line number Diff line number Diff line change @@ -1273,25 +1273,36 @@ PyInit_faulthandler(void)
1273
1273
#ifdef MS_WINDOWS
1274
1274
/* RaiseException() codes (prefixed by an underscore) */
1275
1275
if (PyModule_AddIntConstant (m , "_EXCEPTION_ACCESS_VIOLATION" ,
1276
- EXCEPTION_ACCESS_VIOLATION ))
1277
- return NULL ;
1276
+ EXCEPTION_ACCESS_VIOLATION )) {
1277
+ goto error ;
1278
+ }
1278
1279
if (PyModule_AddIntConstant (m , "_EXCEPTION_INT_DIVIDE_BY_ZERO" ,
1279
- EXCEPTION_INT_DIVIDE_BY_ZERO ))
1280
- return NULL ;
1280
+ EXCEPTION_INT_DIVIDE_BY_ZERO )) {
1281
+ goto error ;
1282
+ }
1281
1283
if (PyModule_AddIntConstant (m , "_EXCEPTION_STACK_OVERFLOW" ,
1282
- EXCEPTION_STACK_OVERFLOW ))
1283
- return NULL ;
1284
+ EXCEPTION_STACK_OVERFLOW )) {
1285
+ goto error ;
1286
+ }
1284
1287
1285
1288
/* RaiseException() flags (prefixed by an underscore) */
1286
1289
if (PyModule_AddIntConstant (m , "_EXCEPTION_NONCONTINUABLE" ,
1287
- EXCEPTION_NONCONTINUABLE ))
1288
- return NULL ;
1290
+ EXCEPTION_NONCONTINUABLE )) {
1291
+ goto error ;
1292
+ }
1289
1293
if (PyModule_AddIntConstant (m , "_EXCEPTION_NONCONTINUABLE_EXCEPTION" ,
1290
- EXCEPTION_NONCONTINUABLE_EXCEPTION ))
1291
- return NULL ;
1294
+ EXCEPTION_NONCONTINUABLE_EXCEPTION )) {
1295
+ goto error ;
1296
+ }
1292
1297
#endif
1293
1298
1294
1299
return m ;
1300
+
1301
+ #ifdef MS_WINDOWS
1302
+ error :
1303
+ Py_DECREF (m );
1304
+ return NULL ;
1305
+ #endif
1295
1306
}
1296
1307
1297
1308
static int
You can’t perform that action at this time.
0 commit comments