Fix NameError in queue.py.
Merge branch 'fix-nameerror'