From: Raul Tambre Date: Sat, 4 May 2019 19:48:17 +0000 (-0400) Subject: Fix incorrect use of 'is' operator for comparison in python/lib/gdb/command/prompt.py X-Git-Tag: binutils-2_33~1381 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b6484282f85bf7f11451b2441599c241d302ad9d;p=external%2Fbinutils.git 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. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 383b353..7eb5d9a 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2019-05-04 Raul Tambre + + * python/lib/gdb/prompt.py (_ExtendedPrompt) + : Fix incorrect use of 'is' + operator for comparison. + 2019-05-04 Tom Tromey * psymtab.c (psymbol_name_matches, match_partial_symbol) diff --git a/gdb/python/lib/gdb/command/prompt.py b/gdb/python/lib/gdb/command/prompt.py index 3d662a7..04b9e49 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