Fallible version of Python::with_gil?
              
              #3386
            
            
              
                Unanswered
              
          
                  
                    
                      ritikmishra
                    
                  
                
                  asked this question in
                Questions
              
            Replies: 2 comments 2 replies
-
| Can you give a repro of how to cause a panic? That will help me have an idea whether a fallible form would be possible. | 
Beta Was this translation helpful? Give feedback.
                  
                    1 reply
                  
                
            -
| Note that there is also another design point for a "fallible" variant of  | 
Beta Was this translation helpful? Give feedback.
                  
                    1 reply
                  
                
            
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
In cases where the Python interpreter is not initialized (e.g during interpreter finalization before process exit),
Python::with_gilwill panic.Is there a way where I can get the GIL in a fallible manner?
(I have a Rust struct that (indirectly) emits a
log::info!message when dropped. I am using PyO3 to have this struct be available in Python, and to also send thislogmessage into the Pythonloggingmodule. However, if the struct is living in global Python scope, it won't be dropped until interpreter finalization)related to vorner/pyo3-log#30
Beta Was this translation helpful? Give feedback.
All reactions