Author ncoghlan
Recipients brett.cannon, eric.snow, gvanrossum, ncoghlan
Date 2014-12-17.23:14:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Looking at the implementation of PyImport_ImportModuleNoBlock, you should be able to invoke that via ctypes with a nonsense module name to probe for whether or not the current thread has the import lock.

A call like 'PyImport_ImportModuleNoBlock("this-is-not-a-legal-module-name")' will always fail with ImportError, but the exception message will be different if another thread holds the import lock. Specifically, it will end with "because the import lock is held by another thread".
Date User Action Args
2014-12-17 23:14:40ncoghlansetrecipients: + ncoghlan, gvanrossum, brett.cannon, eric.snow
2014-12-17 23:14:40ncoghlansetmessageid: <>
2014-12-17 23:14:40ncoghlanlinkissue23068 messages
2014-12-17 23:14:40ncoghlancreate