================ @@ -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") ---------------- DeinAlptraum wrote:
This previously returned the following error: `ctypes.ArgumentError: argument 2: TypeError: expected SourceRange instance instead of NoneType` from the library function since it gets passed `None`. This moves the error into `get_tokens` on Python side, gives a more explicit explanation and lets us guarantee that `TokenGroup.get_tokens()` is always passed a `SourceRange` 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