aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h')
-rw-r--r--contrib/llvm-project/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h15
1 files changed, 1 insertions, 14 deletions
diff --git a/contrib/llvm-project/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h b/contrib/llvm-project/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h
index 2094f0b3afd2..76ad47f2907e 100644
--- a/contrib/llvm-project/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h
+++ b/contrib/llvm-project/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);
@@ -649,7 +636,7 @@ public:
const char *toCString() const;
PythonException(const char *caller = nullptr);
void Restore();
- ~PythonException();
+ ~PythonException() override;
void log(llvm::raw_ostream &OS) const override;
std::error_code convertToErrorCode() const override;
bool Matches(PyObject *exc) const;