python 3 compatibility fix: has_key changed to in