Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Closed
Description
Bug report
Bug description:
importthreadingdefmain():r=threading.RLock()print(f"{r=}")t=threading.Thread(target=r.acquire)t.start()t.join()print(f"{r=}")print(f"{r.locked()=} at{hex(id(r))}")if__name__=='__main__':main()
Output is:
r = <unlocked _thread.RLock object owner=0 count=1 at 0x105a98720>r = <locked _thread.RLock object owner=6106329088 count=1 at 0x105a98720>r.locked() = False at 0x105a98720Error is located at:
Lines 238 to 240 in28625d4
| deflocked(self): | |
| """Return whether this object is locked.""" | |
| returnself._count>0 |
The return instruction must be:
return self._block.locked().I can submit a PR quickly.
CPython versions tested on:
CPython main branch, 3.14
Operating systems tested on:
macOS