kopia lustrzana https://github.com/OpenDroneMap/ODM
Repair bad index checking
isinstance(object, classinfo) checks only if object has correct python type, not value. Let's try this with more traditional method ;)pull/639/head
rodzic
6887f44bda
commit
37e49b132c
|
@ -17,7 +17,8 @@ try:
|
||||||
typ = sys.argv[2]
|
typ = sys.argv[2]
|
||||||
(fileRoot, fileExt) = os.path.splitext(file)
|
(fileRoot, fileExt) = os.path.splitext(file)
|
||||||
outFileName = fileRoot + "_" + typ + fileExt
|
outFileName = fileRoot + "_" + typ + fileExt
|
||||||
isinstance(typ, ['vari', 'tgi', 'ngrdi'])
|
if typ not in ['vari', 'tgi', 'ngrdi']:
|
||||||
|
raise IndexError
|
||||||
except (TypeError, IndexError, NameError):
|
except (TypeError, IndexError, NameError):
|
||||||
print bcolors.FAIL + 'Arguments messed up. Check arguments order and index name' + bcolors.ENDC
|
print bcolors.FAIL + 'Arguments messed up. Check arguments order and index name' + bcolors.ENDC
|
||||||
print 'Usage: ./vegind.py orto index'
|
print 'Usage: ./vegind.py orto index'
|
||||||
|
|
Ładowanie…
Reference in New Issue