def get_and_run_edits(self):
if self.empty():<EOL><INDENT>return<EOL><DEDENT>edits = []<EOL>while True:<EOL><INDENT>try:<EOL><INDENT>edits.append(self.get_nowait())<EOL><DEDENT>except queue.Empty:<EOL><INDENT>break<EOL><DEDENT><DEDENT>for e in edits:<EOL><INDENT>try:<EOL><INDENT>e()<EOL><DEDENT>except:<EOL><INDENT>log.error('<STR_LIT>', e)<EOL>traceback.print_exc()<EOL><DEDENT><DEDENT>
Get all the edits in the queue, then execute them.

The algorithm gets all edits, and then executes all of them.  It does
*not* pull off one edit, execute, repeat until the queue is empty, and
that means that the queue might not be empty at the end of
``run_edits``, because new edits might have entered the queue
while the previous edits are being executed.

This has the advantage that if edits enter the queue faster than they
can be processed, ``get_and_run_edits`` won't go into an infinite loop,
but rather the queue will grow unboundedly, which that can be
detected, and mitigated and reported on - or if Queue.maxsize is
set, ``bp`` will report a fairly clear error and just dump the edits
on the ground.