[issue9247] imp.reload() doesn't take import lock

2012-06-15 Thread Brett Cannon
Brett Cannon added the comment: We have gone this long without a lock for reload(), I don't see a reason to start caring now. -- resolution: -> works for me status: open -> closed ___ Python tracker _

[issue9247] imp.reload() doesn't take import lock

2012-06-06 Thread Eric Snow
Eric Snow added the comment: Yeah, imp.reload() is pure Python now (Lib/imp.py), a simple wrapper around module.__loader__.load_module(), which does not make use of any import locks. Having it do so, however, may not be feasible as I'd expect it to mean having load_module() handle the lockin

[issue9247] imp.reload() doesn't take import lock

2012-06-06 Thread Roger Serwy
Roger Serwy added the comment: I just ran Antoine's test against the latest 3.3a4 build and received this: lock held = False lock held = False Is this issue still relevant given Brett's work on re-implementing import in pure Python? -- nosy: +serwy status: open -> pending __

[issue9247] imp.reload() doesn't take import lock

2010-07-13 Thread Brett Cannon
Brett Cannon added the comment: So the import lock is to prevent trying to import the same module, right? If you are doing a reload, the module is basically already there. But what if you context switch while reloading? That would be bad as that would give you inconsistent state. So it proba

[issue9247] imp.reload() doesn't take import lock

2010-07-13 Thread Antoine Pitrou
New submission from Antoine Pitrou : I am not sure this is important or now, but reload() (imp.reload() in 3.x) doesn't take the import lock when reloading: $ echo 'import imp; print("lock held =", imp.lock_held())' > foo.py $ ./python -c 'import imp, foo; imp.reload(foo)' lock held = True lock