Asana/python-asana

Attribute Error with Python 2.6

Closed this issue · 2 comments

I use your API at my workplace and, for enterprise reasons, use Python 2.6. Unfortunately using your library fails with that version of Python because of line 14 in asana.client, i.e.:

if sys.version_info.major == 3:

The "major" attribute was introduced in 2.7, so I'd appreciate it if you could find a different way to express this, some suggestions:

  • The "forgiveness" approach:
try:
    import urllib.parse as urlparse
except ImportError:
    import urllib as urlparse
  • The "permission" approach:
if hasattr(sys.version_info, 'major') and sys.version_info.major == 3:
    import urllib.parse as urlparse
else:
    import urllib as urlparse

Anyway thanks for building this API, hopefully you update this issue because I don't really like overwriting client libraries.

Tim

Thanks for pointing that out. I went with "forgiveness" :) #29

Will merge and deploy when a team member is able to review it.

@TimothyMullen you should be good to go with v0.4.0