Merge pull request #161 from nno/_tent/py3k

Improve python3 compatibility
RF: use simpler use of "isinstance" as suggested by @yaroptic