Python 3: replace "im_self" by "__self__"

The Python 3 removed the "im_self" attribute. This patch
replaces "im_self" by "__self__" attribute.
Partial-Bug: #1282514

Change-Id: I53567c856b81c9b2fceaf131ee918dd850ac4f03
Merge "Python 3: replace "im_self" by "__self__""