@@ -1841,7 +1841,7 @@ module Python {
18411841 } catch e {
18421842 // an exception thrown from the init will not result in a call to the postinit
18431843 // or the deinit, so we have to handle that stuff here
1844- defer PyGILState_Release( this .gilInitState );
1844+ defer this .ctxInitState. exit ( );
18451845 // rethrow the exception
18461846 throw e;
18471847 }
@@ -1866,7 +1866,7 @@ module Python {
18661866 } catch e {
18671867 // an exception thrown from the init will not result in a call to the postinit
18681868 // or the deinit, so we have to handle that stuff here
1869- defer PyGILState_Release( this .gilInitState );
1869+ defer this .ctxInitState. exit ( );
18701870 // rethrow the exception
18711871 throw e;
18721872 }
@@ -2446,7 +2446,7 @@ module Python {
24462446 } catch e {
24472447 // an exception thrown from the init will not result in a call to the postinit
24482448 // or the deinit, so we have to handle that stuff here
2449- defer PyGILState_Release( this .gilInitState );
2449+ defer this .ctxInitState. exit ( );
24502450 // rethrow the exception
24512451 throw e;
24522452 }
@@ -2470,7 +2470,7 @@ module Python {
24702470 } catch e {
24712471 // an exception thrown from the init will not result in a call to the postinit
24722472 // or the deinit, so we have to handle that stuff here
2473- defer PyGILState_Release( this .gilInitState );
2473+ defer this .ctxInitState. exit ( );
24742474 // rethrow the exception
24752475 throw e;
24762476 }
@@ -2537,7 +2537,7 @@ module Python {
25372537 } catch e {
25382538 // an exception thrown from the init will not result in a call to the postinit
25392539 // or the deinit, so we have to handle that stuff here
2540- defer PyGILState_Release( this .gilInitState );
2540+ defer this .ctxInitState. exit ( );
25412541 // rethrow the exception
25422542 throw e;
25432543 }
0 commit comments