From adbf64ccc9e18278600ebaeadd8f0117eb8e64b1 Mon Sep 17 00:00:00 2001 From: Lawrence D'Anna Date: Mon, 4 Nov 2019 12:48:49 -0800 Subject: [LLDB][Python] remove ArgInfo::count Summary: This patch updates the last user of ArgInfo::count and deletes it. I also delete `GetNumInitArguments()` and `GetInitArgInfo()`. Classess are callables and `GetArgInfo()` should work on them. On python 3 it already works, of course. `inspect` is good. On python 2 we have to add yet another special case. But hey if python 2 wasn't crufty we wouln't need python 3. I also delete `is_bound_method` becuase it is unused. This path is tested in `TestStepScripted.py` Reviewers: labath, mgorny, JDevlieghere Reviewed By: labath, JDevlieghere Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D69742 --- .../Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp') diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp index 15843feae57..e7d9443c5fd 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp @@ -807,8 +807,10 @@ ScriptInterpreterPythonImpl::GetMaxPositionalArgumentsForCallable( llvm::inconvertibleErrorCode(), "can't find callable: %s", callable_name.str().c_str()); } - PythonCallable::ArgInfo arg_info = pfunc.GetNumArguments(); - return arg_info.max_positional_args; + llvm::Expected arg_info = pfunc.GetArgInfo(); + if (!arg_info) + return arg_info.takeError(); + return arg_info.get().max_positional_args; } static std::string GenerateUniqueName(const char *base_name_wanted, -- cgit v1.2.3