clean etherlab: pylint, E1136 # (unsubscriptable-object) Value 'X' is unsubscriptable
authorAndrey Skvortsov <andrej.skvortzov@gmail.com>
Sat, 29 Sep 2018 17:12:44 +0300
changeset 2403 045df8ecc8b3
parent 2402 a1df3102327d
child 2404 87eb184414bd
clean etherlab: pylint, E1136 # (unsubscriptable-object) Value 'X' is unsubscriptable
etherlab/EthercatMaster.py
--- a/etherlab/EthercatMaster.py	Sat Sep 29 17:00:01 2018 +0300
+++ b/etherlab/EthercatMaster.py	Sat Sep 29 17:12:44 2018 +0300
@@ -582,7 +582,7 @@
             entries_list.sort()
             entries = []
             current_index = None
-            current_entry = None
+            current_entry = {}
             for (index, subindex), entry in entries_list:
                 entry["children"] = []
                 if slave_pos is not None:
@@ -591,7 +591,7 @@
                     current_index = index
                     current_entry = entry
                     entries.append(entry)
-                elif current_entry is not None:
+                elif current_entry:
                     current_entry["children"].append(entry)
                 else:
                     entries.append(entry)