django-oscar / django-oscar-docdata

Docdata Payments Gateway integration for django-oscar
Apache License 2.0
23 stars 11 forks source link

Python 3: NameError: name 'long' is not defined #11

Closed jedie closed 5 years ago

jedie commented 5 years ago
   File "/src/django-oscar-docdata/oscar_docdata/gateway.py", line 964, in __init__
     if isinstance(quantity, (int, long)):
 NameError: name 'long' is not defined
jedie commented 5 years ago

I've kept it simple in my fork and just remove "long", see: https://github.com/wearehoods/django-oscar-docdata/commit/37b65994307af8ceeef38b213e7e5e4a51a4ba86

I don't know if you still have to support Python v2 ;)

maerteijn commented 5 years ago

Yes we still have to support python 2 as long as Django 1.11 is alive (LTS release).

So to stay compatible we should change this to:

if isinstance(quantity, six.integer_types): 
jedie commented 5 years ago

Yes we still have to support python 2 as long as Django 1.11 is alive (LTS release)

That's a pity. We are completely on Python 3. Therefore my changes are only for Python 3 and i didn't have time to create a Python 2 setup ;)

maerteijn commented 5 years ago

Fixed in d1145a0b4880018c4d8dffec8ba3c9abce4bfe21

jedie commented 5 years ago

Another fix: https://github.com/wearehoods/django-oscar-docdata/commit/0ea0de982ee02c691f6a866f96d04372a139f9f9