Deprecated removal

Removing deprecated codes.
1. while 1:
2. BaseException
3. dict.has_key()