@@ -1841,7 +1841,7 @@ module Python {
1841
1841
} catch e {
1842
1842
// an exception thrown from the init will not result in a call to the postinit
1843
1843
// or the deinit, so we have to handle that stuff here
1844
- defer PyGILState_Release( this .gilInitState );
1844
+ defer this .ctxInitState. exit ( );
1845
1845
// rethrow the exception
1846
1846
throw e;
1847
1847
}
@@ -1866,7 +1866,7 @@ module Python {
1866
1866
} catch e {
1867
1867
// an exception thrown from the init will not result in a call to the postinit
1868
1868
// or the deinit, so we have to handle that stuff here
1869
- defer PyGILState_Release( this .gilInitState );
1869
+ defer this .ctxInitState. exit ( );
1870
1870
// rethrow the exception
1871
1871
throw e;
1872
1872
}
@@ -2446,7 +2446,7 @@ module Python {
2446
2446
} catch e {
2447
2447
// an exception thrown from the init will not result in a call to the postinit
2448
2448
// or the deinit, so we have to handle that stuff here
2449
- defer PyGILState_Release( this .gilInitState );
2449
+ defer this .ctxInitState. exit ( );
2450
2450
// rethrow the exception
2451
2451
throw e;
2452
2452
}
@@ -2470,7 +2470,7 @@ module Python {
2470
2470
} catch e {
2471
2471
// an exception thrown from the init will not result in a call to the postinit
2472
2472
// or the deinit, so we have to handle that stuff here
2473
- defer PyGILState_Release( this .gilInitState );
2473
+ defer this .ctxInitState. exit ( );
2474
2474
// rethrow the exception
2475
2475
throw e;
2476
2476
}
@@ -2537,7 +2537,7 @@ module Python {
2537
2537
} catch e {
2538
2538
// an exception thrown from the init will not result in a call to the postinit
2539
2539
// or the deinit, so we have to handle that stuff here
2540
- defer PyGILState_Release( this .gilInitState );
2540
+ defer this .ctxInitState. exit ( );
2541
2541
// rethrow the exception
2542
2542
throw e;
2543
2543
}
0 commit comments