summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/ScriptInterpreter/Python
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python')
-rw-r--r--lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp8
-rw-r--r--lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp4
2 files changed, 4 insertions, 8 deletions
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
index 45ffd0813d4..7e96dd9893c 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
@@ -222,9 +222,7 @@ PythonBytes::~PythonBytes() {}
bool PythonBytes::Check(PyObject *py_obj) {
if (!py_obj)
return false;
- if (PyBytes_Check(py_obj))
- return true;
- return false;
+ return PyBytes_Check(py_obj);
}
void PythonBytes::Reset(PyRefType type, PyObject *py_obj) {
@@ -294,9 +292,7 @@ PythonByteArray::~PythonByteArray() {}
bool PythonByteArray::Check(PyObject *py_obj) {
if (!py_obj)
return false;
- if (PyByteArray_Check(py_obj))
- return true;
- return false;
+ return PyByteArray_Check(py_obj);
}
void PythonByteArray::Reset(PyRefType type, PyObject *py_obj) {
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
index 289607e309a..41cb443d4f1 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
@@ -208,7 +208,7 @@ ScriptInterpreterPython::Locker::Locker(ScriptInterpreterPython *py_interpreter,
m_python_interpreter(py_interpreter) {
DoAcquireLock();
if ((on_entry & InitSession) == InitSession) {
- if (DoInitSession(on_entry, in, out, err) == false) {
+ if (!DoInitSession(on_entry, in, out, err)) {
// Don't teardown the session if we didn't init it.
m_teardown_session = false;
}
@@ -2838,7 +2838,7 @@ bool ScriptInterpreterPython::LoadScriptingModule(
bool was_imported = (was_imported_globally || was_imported_locally);
- if (was_imported == true && can_reload == false) {
+ if (was_imported && !can_reload) {
error.SetErrorString("module already imported");
return false;
}
OpenPOWER on IntegriCloud