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.
+2019-05-04 Raul Tambre <raul@tambre.ee>
+
+ * python/lib/gdb/prompt.py (_ExtendedPrompt)
+ <before_prompt_hook, get_show_string>: Fix incorrect use of 'is'
+ operator for comparison.
+
2019-05-04 Tom Tromey <tom@tromey.com>
* psymtab.c (psymbol_name_matches, match_partial_symbol)
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."
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