fix for python3 removed has_key