1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
Description: fix string comparison syntax
Author: Jonas Smedegaard <dr@jones.dk>
Last-Update: 2021-09-23
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/redbaron/base_nodes.py
+++ b/redbaron/base_nodes.py
@@ -687,7 +687,7 @@
if self.parent is None:
return None
- if self.on_attribute is "root":
+ if self.on_attribute == "root":
in_list = self.parent
elif self.on_attribute is not None:
if isinstance(self.parent, NodeList):
@@ -1253,7 +1253,7 @@
parent=last_member, on_attribute="value"))
return ""
- if re.match("^\s*%s" % indented_type, string):
+ if re.match(r"^\s*%s" % indented_type, string):
# we've got indented text, let's deindent it
if string.startswith((" ", " ")):
|