p4r4n0y1ng / pyfmg

Represents the base components of the FortiManager JSON-RPC interface

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Python 3 Support

AaronFoley opened this issue · comments

It would be nice to be able to run this with Python 3 as well.

From my very limited testing, it appears that there is only one line stopping it from been compatible with python3 within the common_datagram_params method:

if kwargs:
            for k, _ in kwargs.iteritems():

If this is changed to use iteritems from furtures:

from future.utils import iteritems
...
if kwargs:
            for (k, _) in iteritems(kwargs):

Knew it would come....... shedding a tear........ will be completed for you probably within the week!

Aaron,
Done. Since I needed just the keys of the hash, I used a list() constructor to do the deed. This ensured nothing even had to be modified in the import area as well. Seems fully python2 and 3 compat at this point. Thanks. Please let me know if you find issues.