Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1d678f8

Browse files
committed
Fix bug in heapq priority queue example.
1 parent 73dd7c7 commit 1d678f8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Doc/library/heapq.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,8 @@ entry as invalid and optionally add a new entry with the revised priority::
191191
def get_top_priority():
192192
while True:
193193
priority, count, task = heappop(pq)
194-
del task_finder[task]
195194
if count is not INVALID:
195+
del task_finder[task]
196196
return task
197197

198198
def delete_task(task):

0 commit comments

Comments
 (0)