Commit a5ed2fe 1 parent 829593a commit a5ed2fe Copy full SHA for a5ed2fe
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 @@ -1276,25 +1276,36 @@ PyInit_faulthandler(void)
1276
1276
#ifdef MS_WINDOWS
1277
1277
/* RaiseException() codes (prefixed by an underscore) */
1278
1278
if (PyModule_AddIntConstant (m , "_EXCEPTION_ACCESS_VIOLATION" ,
1279
- EXCEPTION_ACCESS_VIOLATION ))
1280
- return NULL ;
1279
+ EXCEPTION_ACCESS_VIOLATION )) {
1280
+ goto error ;
1281
+ }
1281
1282
if (PyModule_AddIntConstant (m , "_EXCEPTION_INT_DIVIDE_BY_ZERO" ,
1282
- EXCEPTION_INT_DIVIDE_BY_ZERO ))
1283
- return NULL ;
1283
+ EXCEPTION_INT_DIVIDE_BY_ZERO )) {
1284
+ goto error ;
1285
+ }
1284
1286
if (PyModule_AddIntConstant (m , "_EXCEPTION_STACK_OVERFLOW" ,
1285
- EXCEPTION_STACK_OVERFLOW ))
1286
- return NULL ;
1287
+ EXCEPTION_STACK_OVERFLOW )) {
1288
+ goto error ;
1289
+ }
1287
1290
1288
1291
/* RaiseException() flags (prefixed by an underscore) */
1289
1292
if (PyModule_AddIntConstant (m , "_EXCEPTION_NONCONTINUABLE" ,
1290
- EXCEPTION_NONCONTINUABLE ))
1291
- return NULL ;
1293
+ EXCEPTION_NONCONTINUABLE )) {
1294
+ goto error ;
1295
+ }
1292
1296
if (PyModule_AddIntConstant (m , "_EXCEPTION_NONCONTINUABLE_EXCEPTION" ,
1293
- EXCEPTION_NONCONTINUABLE_EXCEPTION ))
1294
- return NULL ;
1297
+ EXCEPTION_NONCONTINUABLE_EXCEPTION )) {
1298
+ goto error ;
1299
+ }
1295
1300
#endif
1296
1301
1297
1302
return m ;
1303
+
1304
+ #ifdef MS_WINDOWS
1305
+ error :
1306
+ Py_DECREF (m );
1307
+ return NULL ;
1308
+ #endif
1298
1309
}
1299
1310
1300
1311
static int
You can’t perform that action at this time.
0 commit comments