1069 try: |
1074 try: |
1070 tree = ast.parse(context.ssource()) |
1075 tree = ast.parse(context.ssource()) |
1071 except (SyntaxError, TypeError): |
1076 except (SyntaxError, TypeError): |
1072 return |
1077 return |
1073 if (isinstance(tree, ast.Module) and len(tree.body) == 1 and |
1078 if (isinstance(tree, ast.Module) and len(tree.body) == 1 and |
1074 isinstance(tree.body[0], ast.FunctionDef)): |
1079 isinstance(tree.body[0], |
|
1080 (ast.FunctionDef, ast.AsyncFunctionDef))): |
1075 functionDef = tree.body[0] |
1081 functionDef = tree.body[0] |
1076 argNames, kwNames = self.__getArgNames(functionDef) |
1082 argNames, kwNames = self.__getArgNames(functionDef) |
1077 if "self" in argNames: |
1083 if "self" in argNames: |
1078 argNames.remove("self") |
1084 argNames.remove("self") |
1079 if "cls" in argNames: |
1085 if "cls" in argNames: |