Fix for python 2.x.

There is a difference with dict.keys() in Python 2 & 3 versions. So if we use python 2.x, activation will never work. This commit will fix problem.

Python 2.7.5 (default, Aug 25 2013, 00:04:04) 
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> x = {'aaa':1,'bbb':2}
>>> x.keys()
['aaa', 'bbb']
>>> x.keys() == {'aaa','bbb'}
False
>>> x.keys() == ['aaa','bbb']
True
>>> list(x.keys()) == ['bbb', 'aaa']
True

Python 3.4.0 (default, Mar 25 2014, 11:07:05) 
[GCC 4.2.1 Compatible Apple LLVM 5.1 (clang-503.0.38)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> x = {'aaa':1,'bbb':2}
>>> x.keys()
dict_keys(['bbb', 'aaa'])
>>> x.keys() == ['bbb', 'aaa']
False
>>> list(x.keys()) == ['bbb', 'aaa']
True