Fix a return bug when len(setDicts) is zero.
This commit is contained in:
parent
7142621966
commit
87c11e7e2f
1 changed files with 4 additions and 1 deletions
|
@ -111,6 +111,7 @@ def scan_aircraft_dir(aircraft_dir, includes):
|
||||||
files = os.listdir(aircraft_dir)
|
files = os.listdir(aircraft_dir)
|
||||||
for file in sorted(files, key=lambda s: s.lower()):
|
for file in sorted(files, key=lambda s: s.lower()):
|
||||||
if file.endswith('-set.xml'):
|
if file.endswith('-set.xml'):
|
||||||
|
# print 'trying:', file
|
||||||
try:
|
try:
|
||||||
d = scan_set_file(aircraft_dir, file, includes)
|
d = scan_set_file(aircraft_dir, file, includes)
|
||||||
if d == None:
|
if d == None:
|
||||||
|
@ -126,8 +127,10 @@ def scan_aircraft_dir(aircraft_dir, includes):
|
||||||
elif d['variant-of'] == None:
|
elif d['variant-of'] == None:
|
||||||
primaryAircraft.append(d)
|
primaryAircraft.append(d)
|
||||||
|
|
||||||
|
print setDicts
|
||||||
if len(setDicts) == 0:
|
if len(setDicts) == 0:
|
||||||
return None
|
print 'returning none'
|
||||||
|
return None, None
|
||||||
|
|
||||||
# use the first one
|
# use the first one
|
||||||
if len(primaryAircraft) == 0:
|
if len(primaryAircraft) == 0:
|
||||||
|
|
Loading…
Reference in a new issue