Python 3: replace "im_self" by "__self__"

The Python 3 removed the "im_self" attribute and only supports the
"__self__". This patch replaces "im_self" by "__self__" attribute.

Closes-Bug: #1282514
Change-Id: Ib017fff4b720a5dd7ee27fd01b36a531d9b6ca9c
Merge "Python 3: replace "im_self" by "__self__""