bpo-32916: IDLE: Change `str` to `code` in pyparse (GH-5830)
Adjust tests and user modules to match.
(cherry picked from commit c29c03a34a9f3c82704b66f323ce5ea9dc89c8af)
Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
diff --git a/Lib/idlelib/editor.py b/Lib/idlelib/editor.py
index b51c45c..ab9c7e6 100644
--- a/Lib/idlelib/editor.py
+++ b/Lib/idlelib/editor.py
@@ -1302,7 +1302,7 @@
startat = max(lno - context, 1)
startatindex = repr(startat) + ".0"
rawtext = text.get(startatindex, "insert")
- y.set_str(rawtext)
+ y.set_code(rawtext)
bod = y.find_good_parse_start(
self.context_use_ps1,
self._build_char_in_string_func(startatindex))
@@ -1316,7 +1316,7 @@
else:
startatindex = "1.0"
rawtext = text.get(startatindex, "insert")
- y.set_str(rawtext)
+ y.set_code(rawtext)
y.set_lo(0)
c = y.get_continuation_type()