@@ -115,7 +115,7 @@ def toConsole(self, level):
115115 ``level`` (:class:`python:int`)
116116 The recursion level, used as ``" " * level`` to indent children.
117117 """
118- print ("{0}{1 }" .format (" " * level , self ))
118+ print ("{}{ }" .format (" " * level , self ))
119119 for child in self .children :
120120 child .toConsole (level + 1 )
121121
@@ -554,7 +554,7 @@ def _reparent_all(self):
554554 self .unions .remove (u )
555555
556556 def _track_node (self , node ):
557- lst_name = "Mapping from node.kind={0 } to internal list not found." .format (node .kind )
557+ lst_name = "Mapping from node.kind={} to internal list not found." .format (node .kind )
558558 kind = node .kind
559559 if kind in ["class" , "struct" ]:
560560 lst_name = "class_like"
@@ -580,7 +580,7 @@ def _track_node(self, node):
580580 lst_name = "variables"
581581
582582 if lst_name not in self .__dict__ .keys ():
583- raise ValueError ("Invalid internal list name: {0 }" .format (lst_name ))
583+ raise ValueError ("Invalid internal list name: {}" .format (lst_name ))
584584
585585 if node not in self .__dict__ [lst_name ]:
586586 self .__dict__ [lst_name ].append (node )
@@ -594,14 +594,14 @@ def _visit_children(self, parent, child_spec):
594594 if isinstance (parent , function ):
595595 if not isinstance (child_spec , parameters ):
596596 raise ValueError (
597- "Specification of 'function' [{0 }] must be of type 'parameters'" .format (parent .name )
597+ "Specification of 'function' [{}] must be of type 'parameters'" .format (parent .name )
598598 )
599599 else :
600600 parent .setParameters (child_spec )
601601 return
602602 else :
603603 raise ValueError (
604- "Specification of '{0 }' [{1 }] must be a dictionary." .format (parent .kind , parent .name )
604+ "Specification of '{}' [{}] must be a dictionary." .format (parent .kind , parent .name )
605605 )
606606
607607 for child in child_spec :
@@ -653,7 +653,7 @@ def _visit_children(self, parent, child_spec):
653653 child .name = os .path .join (parent .name , child .name )
654654 # simulate how Doxygen will present fully qualified names
655655 if parent .kind in ["class" , "struct" , "namespace" ]:
656- child .name = "{0 }::{1 }" .format (parent .name , child .name )
656+ child .name = "{}::{}" .format (parent .name , child .name )
657657 if self .hierarchy_type == "file" :
658658 child .def_in_file = parent .def_in_file
659659 if child .kind == "namespace" :
@@ -1185,7 +1185,7 @@ def compare_class_hierarchy(test, test_root):
11851185 if exhale_obj is None :
11861186 test .assertTrue (
11871187 False ,
1188- msg = "Did not find match for [{0 }] {1 }" .format (test_obj .kind , test_obj .name )
1188+ msg = "Did not find match for [{}] {}" .format (test_obj .kind , test_obj .name )
11891189 )
11901190
11911191 _compare_children ("class" , test , test_obj , exhale_obj )
@@ -1240,7 +1240,7 @@ def compare_file_hierarchy(test, test_root):
12401240 break
12411241
12421242 if exhale_obj is None :
1243- raise RuntimeError ("Did not find match for [{0 }] {1 }" .format (
1243+ raise RuntimeError ("Did not find match for [{}] {}" .format (
12441244 test_obj .kind , test_obj .name
12451245 ))
12461246 _compare_children ("file" , test , test_obj , exhale_obj )
@@ -1321,10 +1321,10 @@ def set_error_string(s):
13211321 "Function overload group [{group}]:\n Test:\n {test_ids}\n \n Exhale:\n {exhale_ids}\n " .format (
13221322 group = key ,
13231323 test_ids = "" .join (
1324- "\n - {0 }" .format (f .full_signature ()) for f in test_overloads [key ]
1324+ "\n - {}" .format (f .full_signature ()) for f in test_overloads [key ]
13251325 ),
13261326 exhale_ids = "" .join (
1327- "\n - {0 }" .format (f .full_signature ()) for f in exhale_overloads [key ]
1327+ "\n - {}" .format (f .full_signature ()) for f in exhale_overloads [key ]
13281328 )
13291329 )
13301330 )
0 commit comments