aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2022-04-25 20:14:44 -0700
committerJonas Devlieghere <jonas@devlieghere.com>2022-04-27 08:26:25 -0700
commit90537673302f13e92ffabba84901164c6b974b2d (patch)
treecd66c08919923e7809fa146451a4e8df47f0f847 /lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h
parent16baf59c6d0b3bf7392995e3e55fc9e2ba9cb5e7 (diff)
downloadllvm-90537673302f13e92ffabba84901164c6b974b2d.zip
llvm-90537673302f13e92ffabba84901164c6b974b2d.tar.gz
llvm-90537673302f13e92ffabba84901164c6b974b2d.tar.bz2
Remove Python 2 support from the ScriptInterpreter plugin
We dropped downstream support for Python 2 in the previous release. Now that we have branched for the next release the window where this kind of change could introduce conflicts is closing too. Start by getting rid of Python 2 support in the Script Interpreter plugin. Differential revision: https://reviews.llvm.org/D124429
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h')
-rw-r--r--lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h13
1 files changed, 0 insertions, 13 deletions
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h
index 2094f0b..8f379d4 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h
@@ -181,13 +181,7 @@ inline llvm::Error keyError() {
"key not in dict");
}
-#if PY_MAJOR_VERSION < 3
-// The python 2 API declares some arguments as char* that should
-// be const char *, but it doesn't actually modify them.
-inline char *py2_const_cast(const char *s) { return const_cast<char *>(s); }
-#else
inline const char *py2_const_cast(const char *s) { return s; }
-#endif
enum class PyInitialValue { Invalid, Empty };
@@ -391,14 +385,9 @@ llvm::Expected<std::string> As<std::string>(llvm::Expected<PythonObject> &&obj);
template <class T> class TypedPythonObject : public PythonObject {
public:
- // override to perform implicit type conversions on Reset
- // This can be eliminated once we drop python 2 support.
- static void Convert(PyRefType &type, PyObject *&py_obj) {}
-
TypedPythonObject(PyRefType type, PyObject *py_obj) {
if (!py_obj)
return;
- T::Convert(type, py_obj);
if (T::Check(py_obj))
PythonObject::operator=(PythonObject(type, py_obj));
else if (type == PyRefType::Owned)
@@ -453,7 +442,6 @@ public:
explicit PythonString(llvm::StringRef string); // safe, null on error
static bool Check(PyObject *py_obj);
- static void Convert(PyRefType &type, PyObject *&py_obj);
llvm::StringRef GetString() const; // safe, empty string on error
@@ -475,7 +463,6 @@ public:
explicit PythonInteger(int64_t value);
static bool Check(PyObject *py_obj);
- static void Convert(PyRefType &type, PyObject *&py_obj);
void SetInteger(int64_t value);