Browse Source

Fixed type-error occuring for single-element query results

Stefan Schmidt 6 years ago
parent
commit
b788c425a6
1 changed files with 1 additions and 1 deletions
  1. 1 1
      code/ID2TLib/StatsDatabase.py

+ 1 - 1
code/ID2TLib/StatsDatabase.py

@@ -298,7 +298,7 @@ class StatsDatabase:
 
 
         # Print results if option print_results is True
         # Print results if option print_results is True
         if print_results:
         if print_results:
-            if len(result) == 1 and isinstance(result, list):
+            if isinstance(result, list) and len(result) == 1:
                 result = result[0]
                 result = result[0]
                 print("Query returned 1 record:\n")
                 print("Query returned 1 record:\n")
                 for i in range(0, len(result)):
                 for i in range(0, len(result)):