Message247881
You're absolutely right. I had elided the details of the locking from my original use case, but now I look at it again, I see that even what I did have wasn't enough.
I've made a new patch that takes a lock properly. A non-blocking acquisition of the lock will serve the same purpose as looking to see if there is a line being read, and will also prevent the interpreter from starting to read a new line while the text is being printed.
My use case now looks like this.
reading_lock = threading.Lock ()
readline.set_lock (reading_lock)
def describe (indicator):
if reading_lock.acquire (False):
print (indicator.description)
reading_lock.release ()
else:
print ()
print (indicator.description)
readline.forced_update_display () |
|
Date |
User |
Action |
Args |
2015-08-02 16:37:23 | Barney Stratford | set | recipients:
+ Barney Stratford, twouters, martin.panter |
2015-08-02 16:37:23 | Barney Stratford | set | messageid: <1438533443.6.0.457480320473.issue24727@psf.upfronthosting.co.za> |
2015-08-02 16:37:23 | Barney Stratford | link | issue24727 messages |
2015-08-02 16:37:23 | Barney Stratford | create | |
|