Skip to content

[lldb] Fix misleading indentiation warning in ScriptInterpreterPython (NFC) #70732

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 30, 2023

Conversation

medismailben
Copy link
Member

@medismailben medismailben commented Oct 30, 2023

This should silence the "misleading indentiation" warnings introduced by b2929be, by adding an no-op if-statement, if the surrounding if-statement have been compiled out.

@medismailben
Copy link
Member Author

The warning was introduced by #70445 (cc. @tuliom).

… (NFC)

This should silence the "misleading indentiation" warnings introduced by
b2929be, by adding an no-op if-statement, if the surrounding if-statement
have been compiled out.

Signed-off-by: Med Ismail Bennani <[email protected]>
@medismailben medismailben force-pushed the silence-indent-warning branch from 4b21aec to 4ec2b31 Compare October 30, 2023 23:16
@llvmbot llvmbot added the lldb label Oct 30, 2023
@llvmbot
Copy link
Member

llvmbot commented Oct 30, 2023

@llvm/pr-subscribers-lldb

Author: Med Ismail Bennani (medismailben)

Changes

This should silence the "misleading indentiation" warnings introduced by b2929be, by ignoring the flag for that specific chunk of code, if the surrounding if-statement have been compiled out.


Full diff: https://github.com/llvm/llvm-project/pull/70732.diff

1 Files Affected:

  • (modified) lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp (+4)
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
index 968cc8ca03001e5..953f8b3aba18f79 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
@@ -183,6 +183,8 @@ struct InitializePythonRAII {
 // Python 3.13. It has been returning `true` always since Python 3.7.
 #if (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION < 9) || (PY_MAJOR_VERSION < 3)
     if (PyEval_ThreadsInitialized()) {
+#else
+    if (true) {
 #endif
       Log *log = GetLog(LLDBLog::Script);
 
@@ -199,6 +201,8 @@ struct InitializePythonRAII {
 
     // InitThreads acquires the GIL if it hasn't been called before.
     PyEval_InitThreads();
+#else
+    }
 #endif
   }
 

@medismailben medismailben merged commit 8a786be into llvm:main Oct 30, 2023
@tuliom
Copy link
Contributor

tuliom commented Oct 31, 2023

Thank you!

medismailben added a commit to medismailben/llvm-project that referenced this pull request Nov 6, 2023
… (NFC) (llvm#70732)

This should silence the "misleading indentiation" warnings introduced by
b2929be, by adding an no-op if-statement, if the surrounding
if-statement have been compiled out.

Signed-off-by: Med Ismail Bennani <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants