diff -r 3985549d7d36 -r c5c2a74e9382 src/eric7/Utilities/ClassBrowsers/pyclbr.py --- a/src/eric7/Utilities/ClassBrowsers/pyclbr.py Wed Jan 25 10:08:19 2023 +0100 +++ b/src/eric7/Utilities/ClassBrowsers/pyclbr.py Wed Jan 25 13:43:10 2023 +0100 @@ -454,11 +454,11 @@ break start, i = m.capturedStart(), m.capturedEnd() - if m.hasCaptured("MethodModifier"): + if m.captured("MethodModifier"): modifierIndent = _indent(m.captured("MethodModifierIndent")) modifierType = m.captured("MethodModifierType") - elif m.hasCaptured("Method"): + elif m.captured("Method"): # found a method definition or function thisindent = _indent(m.captured("MethodIndent")) meth_name = m.captured("MethodName") @@ -539,10 +539,10 @@ modifierType = ClbrBaseClasses.Function.General modifierIndent = -1 - elif m.hasCaptured("String"): + elif m.captured("String"): pass - elif m.hasCaptured("Class"): + elif m.captured("Class"): # we found a class definition thisindent = _indent(m.captured("ClassIndent")) # close all classes indented at least as much @@ -606,7 +606,7 @@ classstack[-1][0]._addclass(class_name, cur_class) classstack.append((cur_class, thisindent)) - elif m.hasCaptured("Attribute"): + elif m.captured("Attribute"): lineno += src.count("\n", last_lineno_pos, start) last_lineno_pos = start index = -1 @@ -620,13 +620,13 @@ else: index -= 1 - elif m.hasCaptured("Main"): + elif m.captured("Main"): # 'main' part of the script, reset class stack lineno += src.count("\n", last_lineno_pos, start) last_lineno_pos = start classstack = [] - elif m.hasCaptured("Variable"): + elif m.captured("Variable"): thisindent = _indent(m.captured("VariableIndent")) variable_name = m.captured("VariableName") lineno += src.count("\n", last_lineno_pos, start) @@ -654,7 +654,7 @@ ) break - elif m.hasCaptured("Publics"): + elif m.captured("Publics"): idents = m.captured("Identifiers") lineno += src.count("\n", last_lineno_pos, start) last_lineno_pos = start @@ -669,7 +669,7 @@ ) dictionary["__all__"] = pubs - elif m.hasCaptured("Import"): + elif m.captured("Import"): # - import module names = [ n.strip() @@ -684,7 +684,7 @@ for name in names: dictionary["@@Import@@"].addImport(name, [], lineno) - elif m.hasCaptured("ImportFrom"): + elif m.captured("ImportFrom"): # - from module import stuff mod = m.captured("ImportFromPath") namesLines = ( @@ -703,7 +703,7 @@ dictionary["@@Import@@"] = Imports(module, file) dictionary["@@Import@@"].addImport(mod, names, lineno) - elif m.hasCaptured("ConditionalDefine"): + elif m.captured("ConditionalDefine"): # a conditional function/method definition thisindent = _indent(m.captured("ConditionalDefineIndent")) while conditionalsstack and conditionalsstack[-1] >= thisindent: @@ -713,7 +713,7 @@ conditionalsstack.append(thisindent) deltaindentcalculated = False - elif m.hasCaptured("CodingLine"): + elif m.captured("CodingLine"): # a coding statement coding = m.captured("Coding") lineno += src.count("\n", last_lineno_pos, start)