New submission from Guido van Rossum:

imp.lock_held() returns True if *any* thread is currently importing something. 
I'd like to have an API that can tell whether the *current* thread has the 
import lock.  The implementation keeps track of this, but doesn't make the info 

Use case: print a warning/error if a network call is made during import.

components: Library (Lib)
messages: 232792
nosy: gvanrossum
priority: normal
severity: normal
stage: needs patch
status: open
title: Add a way to determine if the current thread has the import lock
type: enhancement
versions: Python 3.5

Python tracker <>
Python-bugs-list mailing list

Reply via email to