[Lldb-commits] [lldb] [lldb] fix(lldb/**.py): fix comparison to None (PR #94017)

2024-06-26 Thread via lldb-commits

github-actions[bot] wrote:



@e-kwsm Congratulations on having your first Pull Request (PR) merged into the 
LLVM Project!

Your changes will be combined with recent changes from other authors, then 
tested
by our [build bots](https://lab.llvm.org/buildbot/). If there is a problem with 
a build, you may receive a report in an email or a comment on this PR.

Please check whether problems have been caused by your change specifically, as
the builds can include changes from many authors. It is not uncommon for your
change to be included in a build that fails due to someone else's changes, or
infrastructure issues.

How to do this, and the rest of the post-merge process, is covered in detail 
[here](https://llvm.org/docs/MyFirstTypoFix.html#myfirsttypofix-issues-after-landing-your-pr).

If your change does cause a problem, it may be reverted, or you can revert it 
yourself.
This is a normal part of [LLVM 
development](https://llvm.org/docs/DeveloperPolicy.html#patch-reversion-policy).
 You can fix your changes and open a new PR to merge them again.

If you don't get any reports, no action is required from you. Your changes are 
working as expected, well done!


https://github.com/llvm/llvm-project/pull/94017
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] fix(lldb/**.py): fix comparison to None (PR #94017)

2024-06-26 Thread David Spickett via lldb-commits

https://github.com/DavidSpickett closed 
https://github.com/llvm/llvm-project/pull/94017
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] fix(lldb/**.py): fix comparison to None (PR #94017)

2024-06-23 Thread Eisuke Kawashima via lldb-commits

https://github.com/e-kwsm updated 
https://github.com/llvm/llvm-project/pull/94017

>From a10dbbe288bdb115df56ef60c48f9efbf6642bd3 Mon Sep 17 00:00:00 2001
From: Eisuke Kawashima 
Date: Sat, 11 May 2024 23:57:11 +0900
Subject: [PATCH] fix(lldb/**.py): fix comparison to None

from PEP8 (https://peps.python.org/pep-0008/#programming-recommendations):

> Comparisons to singletons like None should always be done with is or
> is not, never the equality operators.
---
 lldb/bindings/interface/SBBreakpointDocstrings.i  | 2 +-
 lldb/bindings/interface/SBDataExtensions.i| 8 
 lldb/docs/use/python.rst  | 4 ++--
 lldb/examples/python/armv7_cortex_m_target_defintion.py   | 2 +-
 lldb/packages/Python/lldbsuite/test/dotest.py | 2 +-
 lldb/packages/Python/lldbsuite/test/lldbtest.py   | 6 +++---
 lldb/packages/Python/lldbsuite/test/lldbutil.py   | 6 +++---
 .../lldbsuite/test/tools/intelpt/intelpt_testcase.py  | 2 +-
 .../address_breakpoints/TestBadAddressBreakpoints.py  | 2 +-
 .../API/functionalities/step_scripted/TestStepScripted.py | 2 +-
 .../TestStopOnSharedlibraryEvents.py  | 2 +-
 lldb/test/API/lua_api/TestLuaAPI.py   | 2 +-
 .../macosx/thread_suspend/TestInternalThreadSuspension.py | 2 +-
 lldb/test/API/python_api/event/TestEvents.py  | 2 +-
 .../process/read-mem-cstring/TestReadMemCString.py| 2 +-
 lldb/test/API/python_api/type/TestTypeList.py | 2 +-
 lldb/test/API/python_api/was_interrupted/interruptible.py | 2 +-
 lldb/test/Shell/lit.cfg.py| 2 +-
 18 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/lldb/bindings/interface/SBBreakpointDocstrings.i 
b/lldb/bindings/interface/SBBreakpointDocstrings.i
index 74c139d5d9fb6..dca2819a9927b 100644
--- a/lldb/bindings/interface/SBBreakpointDocstrings.i
+++ b/lldb/bindings/interface/SBBreakpointDocstrings.i
@@ -39,7 +39,7 @@ TestBreakpointIgnoreCount.py),::
 #lldbutil.print_stacktraces(process)
 from lldbutil import get_stopped_thread
 thread = get_stopped_thread(process, lldb.eStopReasonBreakpoint)
-self.assertTrue(thread != None, 'There should be a thread stopped due 
to breakpoint')
+self.assertTrue(thread is not None, 'There should be a thread stopped 
due to breakpoint')
 frame0 = thread.GetFrameAtIndex(0)
 frame1 = thread.GetFrameAtIndex(1)
 frame2 = thread.GetFrameAtIndex(2)
diff --git a/lldb/bindings/interface/SBDataExtensions.i 
b/lldb/bindings/interface/SBDataExtensions.i
index d980e79221c6d..ddea77a088dfa 100644
--- a/lldb/bindings/interface/SBDataExtensions.i
+++ b/lldb/bindings/interface/SBDataExtensions.i
@@ -40,19 +40,19 @@ STRING_EXTENSION_OUTSIDE(SBData)
 lldbtarget = lldbdict['target']
 else:
 lldbtarget = None
-if target == None and lldbtarget != None and lldbtarget.IsValid():
+if target is None and lldbtarget is not None and 
lldbtarget.IsValid():
 target = lldbtarget
-if ptr_size == None:
+if ptr_size is None:
 if target and target.IsValid():
 ptr_size = target.addr_size
 else:
 ptr_size = 8
-if endian == None:
+if endian is None:
 if target and target.IsValid():
 endian = target.byte_order
 else:
 endian = lldbdict['eByteOrderLittle']
-if size == None:
+if size is None:
 if value > 2147483647:
 size = 8
 elif value < -2147483648:
diff --git a/lldb/docs/use/python.rst b/lldb/docs/use/python.rst
index 6183d6935d80e..d9c29d95708c1 100644
--- a/lldb/docs/use/python.rst
+++ b/lldb/docs/use/python.rst
@@ -75,13 +75,13 @@ later explanations:
12: if root_word == word:
13: return cur_path
14: elif word < root_word:
-   15: if left_child_ptr.GetValue() == None:
+   15: if left_child_ptr.GetValue() is None:
16: return ""
17: else:
18: cur_path = cur_path + "L"
19: return DFS (left_child_ptr, word, cur_path)
20: else:
-   21: if right_child_ptr.GetValue() == None:
+   21: if right_child_ptr.GetValue() is None:
22: return ""
23: else:
24: cur_path = cur_path + "R"
diff --git a/lldb/examples/python/armv7_cortex_m_target_defintion.py 
b/lldb/examples/python/armv7_cortex_m_target_defintion.py
index 42eaa39993dae..8225670f33e6b 100755
--- a/lldb/examples/python/armv7_cortex_m_target_defintion.py
+++ b/lldb/examples/python/armv7_cortex_m_target_defintion.py
@@ -222,7 +222,7 @@ def get_reg_num(reg_num_dict, reg_name):
 
 def get_target_definition():
 global g_target_defini

[Lldb-commits] [lldb] [lldb] fix(lldb/**.py): fix comparison to None (PR #94017)

2024-06-03 Thread David Spickett via lldb-commits

https://github.com/DavidSpickett approved this pull request.

Changes LGTM.

https://github.com/llvm/llvm-project/pull/94017
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] fix(lldb/**.py): fix comparison to None (PR #94017)

2024-06-03 Thread David Spickett via lldb-commits

DavidSpickett wrote:

I approved the workflows on this and your other changes.

> We detected that you are using a GitHub private e-mail address to contribute 
> to the repo

Please address this and then we can get this merged.

https://github.com/llvm/llvm-project/pull/94017
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] fix(lldb/**.py): fix comparison to None (PR #94017)

2024-06-03 Thread David Spickett via lldb-commits

https://github.com/DavidSpickett edited 
https://github.com/llvm/llvm-project/pull/94017
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits