desihub / specsim

Quick simulations of spectrograph response
2 stars 9 forks source link

compatible with py2 and py3 without 2to3 #48

Closed sbailey closed 8 years ago

sbailey commented 8 years ago

This PR fixes #47 by making the code genuinely py2.7 and 3.5 compatible, rather than relying upon 2to3 conversions to be applied on-the-fly during installation. Most changes are innocuous, though I'll admit that this is a bit yucky:

try:
    basestring          #- exists in py2
except NameError:
    basestring = str    #- for py3

I set use_2to3=False in setup.py so that any other non-py3 compatible changes will trigger a test failure. If that becomes problematic we could revert to use_2to3=True, but in the meantime it would be handy to have the code natively be py3.5 compatible.