space-physics / lowtran

LOWTRAN atmospheric absorption extinction, scatter and irradiance model--in Python and Matlab
MIT License
102 stars 42 forks source link

DemoLowtran.py fails in Python 2.7 #2

Closed brian-rose closed 7 years ago

brian-rose commented 7 years ago

Great package! The demo script fails on Python 2.7 because the exist_ok parameter for os.makedirs() is not supported. The demo runs smoothly when I replace

    makedirs('out',exist_ok=True)

with

    makedirs('out')
drhirsch commented 7 years ago

Hi @brian-rose thanks for your note. In Python2, if the directory already exists you'll get OSError: [Errno 17] File exists: '.local' and in Python3 the same FileExistsError.

In this case the makedirs was not really needed so I removed it. Everything does run then in Python 2.7 and 3.6