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: Icd255eec61f225e2dc66a7efd51551f4b78ac258
Merge "Python 3: replace "im_self" by "__self__""