From 87c11e7e2f4c0b3c418dd6afa5d0c1f5146a65e1 Mon Sep 17 00:00:00 2001 From: "Curtis L. Olson" Date: Tue, 26 Sep 2017 06:26:49 -0500 Subject: [PATCH] Fix a return bug when len(setDicts) is zero. --- catalog/catalog.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/catalog/catalog.py b/catalog/catalog.py index ecad6ff..acdb5ed 100644 --- a/catalog/catalog.py +++ b/catalog/catalog.py @@ -111,6 +111,7 @@ def scan_aircraft_dir(aircraft_dir, includes): files = os.listdir(aircraft_dir) for file in sorted(files, key=lambda s: s.lower()): if file.endswith('-set.xml'): + # print 'trying:', file try: d = scan_set_file(aircraft_dir, file, includes) if d == None: @@ -126,8 +127,10 @@ def scan_aircraft_dir(aircraft_dir, includes): elif d['variant-of'] == None: primaryAircraft.append(d) + print setDicts if len(setDicts) == 0: - return None + print 'returning none' + return None, None # use the first one if len(primaryAircraft) == 0: