Update imap_worker.py

for python 2.5 or lower