anjaroesel / netcdf4-python

Automatically exported from code.google.com/p/netcdf4-python
Other
0 stars 0 forks source link

exception when calling setup.py with no argument #198

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Running "python setup.py" without an arg throws the following 

Traceback (most recent call last):
  File "setup.py", line 231, in <module>
    if sys.argv[1] == 'build' and os.path.exists('netCDF4.c'):
IndexError: list index out of range

The fix is pretty simple (line 231):

if len(sys.argv) >= 2 and sys.argv[1] == 'build'\
   and os.path.exists('netCDF4.c'):
    os.remove('netCDF4.c')

Original issue reported on code.google.com by adrian.m...@gmail.com on 17 Sep 2013 at 6:01

GoogleCodeExporter commented 8 years ago
Thanks! Committed you suggested change to svn HEAD.

Original comment by whitaker.jeffrey@gmail.com on 17 Sep 2013 at 5:31

GoogleCodeExporter commented 8 years ago
perhaps my simple fix should  be:

if len(sys.argv) >= 2 and 'build' in sys.argv[1:] \
   and os.path.exists('netCDF4.c'):
    os.remove('netCDF4.c')

e.g. have multiple args and 'build' isn't the first (e.g. a --flag)

Original comment by adrian.m...@gmail.com on 19 Sep 2013 at 2:57

GoogleCodeExporter commented 8 years ago

Original comment by whitaker.jeffrey@gmail.com on 26 Feb 2014 at 2:04