@@ -29,7 +29,7 @@ def __init__(self) -> None:
2929 """
3030
3131 self ._cpp_factory = CppStateFactory ()
32- self ._xml_path = ""
32+ self ._xml_path : str = ""
3333
3434 def create_state (self , state_elem : ET .Element ) -> State :
3535 """
@@ -42,7 +42,6 @@ def create_state(self, state_elem: ET.Element) -> State:
4242 ValueError: If the state type is unknown or if required attributes
4343 are missing.
4444 """
45-
4645 state_type = state_elem .attrib .get ("type" , "py" )
4746 class_name = state_elem .attrib ["class" ]
4847
@@ -52,11 +51,10 @@ def create_state(self, state_elem: ET.Element) -> State:
5251 state_class = getattr (module , class_name )
5352 return state_class ()
5453
55- elif state_type == "cpp" :
54+ if state_type == "cpp" :
5655 return self ._cpp_factory .create (class_name )
5756
58- else :
59- raise ValueError (f"Unknown state type: { state_type } " )
57+ raise ValueError (f"Unknown state type: { state_type } " )
6058
6159 def create_concurrence (self , conc_elem : ET .Element ) -> Concurrence :
6260 """
@@ -121,11 +119,11 @@ def create_sm(self, root: ET.Element) -> StateMachine:
121119 try :
122120 package_path = get_package_share_path (package )
123121 file_path = ""
124- for root , dirs , files in os .walk (package_path ):
122+ for dirpath , _ , files in os .walk (package_path ):
125123 if file_name in files :
126- file_path = os .path .join (root , file_name )
124+ file_path = os .path .join (dirpath , file_name )
127125 break
128- except Exception as e :
126+ except Exception :
129127 file_path = ""
130128
131129 if file_path :
0 commit comments