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.
This commit is contained in:
parent
af97b4161f
commit
b6484282f8
2 changed files with 8 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue