Fixing #42 NameError: cmp issue

I'm facing the same issue #42 with Python 3.2. This fixing issue for me.