Accepting request 796085 from devel:gcc

- Fix python 3.8 warning [bsc#1169495].
  * gdb-fix-incorrect-use-of-is-operator-for-comparison-in-python-lib-gdb-command-prompt.py.patch (forwarded request 795972 from tomdevries)

OBS-URL: https://build.opensuse.org/request/show/796085
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/gdb?expand=0&rev=139
This commit is contained in:
Dominique Leuenberger 2020-04-23 16:29:32 +00:00 committed by Git OBS Bridge
commit d4d12f41b7
3 changed files with 40 additions and 0 deletions

View File

@ -0,0 +1,32 @@
Fix incorrect use of 'is' operator for comparison in python/lib/gdb/command/prompt.py
The 'is' operator is not meant to be used for comparisons. It currently working
is an implementation detail of CPython. CPython 3.8 has added a SyntaxWarning
for this.
---
gdb/python/lib/gdb/command/prompt.py | 4 ++--
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/gdb/python/lib/gdb/command/prompt.py b/gdb/python/lib/gdb/command/prompt.py
index 3d662a7d3f..04b9e49c22 100644
--- a/gdb/python/lib/gdb/command/prompt.py
+++ b/gdb/python/lib/gdb/command/prompt.py
@@ -45,7 +45,7 @@ The currently defined substitutions are:
self.hook_set = False
def get_show_string (self, pvalue):
- if self.value is not '':
+ if self.value:
return "The extended prompt is: " + self.value
else:
return "The extended prompt is not set."
@@ -57,7 +57,7 @@ The currently defined substitutions are:
return ""
def before_prompt_hook(self, current):
- if self.value is not '':
+ if self.value:
return gdb.prompt.substitute_prompt(self.value)
else:
return None

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon Apr 20 14:29:12 UTC 2020 - Tom de Vries <tdevries@suse.com>
- Fix python 3.8 warning [bsc#1169495].
* gdb-fix-incorrect-use-of-is-operator-for-comparison-in-python-lib-gdb-command-prompt.py.patch
-------------------------------------------------------------------
Tue Apr 14 07:40:12 UTC 2020 - Tom de Vries <tdevries@suse.com>

View File

@ -252,6 +252,7 @@ Patch2013: gdb-arch13-1.diff
Patch2014: gdb-arch13-2.diff
Patch2015: gdb-arch13-3.diff
Patch2016: bfd-change-num_group-to-unsigned-int.patch
Patch2017: gdb-fix-incorrect-use-of-is-operator-for-comparison-in-python-lib-gdb-command-prompt.py.patch
# Proposed patch for PR symtab/24971
Patch2500: gdb-symtab-prefer-var-def-over-decl.patch
@ -612,6 +613,7 @@ find -name "*.info*"|xargs rm -f
%patch2014 -p1
%patch2015 -p1
%patch2016 -p1
%patch2017 -p1
%patch2500 -p1
%patch2501 -p1