Making device discovery Py3 compatible