Update plugin.py for python 3