================ @@ -3466,6 +3479,8 @@ def get_tokens(self, locations=None, extent=None): """ if locations is not None: extent = SourceRange(start=locations[0], end=locations[1]) + if extent is None: + raise TypeError("get_tokens() requires at least one argument") ---------------- Endilll wrote:
Can you move this check up, and test both arguments for None? I don't like how it depends on the previous `if` to work. https://github.com/llvm/llvm-project/pull/138074 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits