diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2021-12-27 16:15:44 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-27 16:15:44 (GMT) |
commit | 576e38f9db61ca09ca6dc57ad13b02a7bf9d370a (patch) | |
tree | 6112f975dc389f687c223a6a0efb19a540519cae /Lib/test | |
parent | bb0b5c12419b8fa657c96185d62212aea975f500 (diff) | |
download | cpython-576e38f9db61ca09ca6dc57ad13b02a7bf9d370a.zip cpython-576e38f9db61ca09ca6dc57ad13b02a7bf9d370a.tar.gz cpython-576e38f9db61ca09ca6dc57ad13b02a7bf9d370a.tar.bz2 |
bpo-42918: Improve built-in function compile() in mode 'single' (GH-29934) (GH-30040)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
(cherry picked from commit 28179aac796ed1debdce336c4b8ca18e8475d40d)
Co-authored-by: Weipeng Hong <hongweichen8888@sina.com>
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_compile.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py index 4de5448..5f80a58 100644 --- a/Lib/test/test_compile.py +++ b/Lib/test/test_compile.py @@ -502,6 +502,7 @@ if 1: self.compile_single("if x:\n f(x)") self.compile_single("if x:\n f(x)\nelse:\n g(x)") self.compile_single("class T:\n pass") + self.compile_single("c = '''\na=1\nb=2\nc=3\n'''") def test_bad_single_statement(self): self.assertInvalidSingle('1\n2') @@ -512,6 +513,7 @@ if 1: self.assertInvalidSingle('f()\n# blah\nblah()') self.assertInvalidSingle('f()\nxy # blah\nblah()') self.assertInvalidSingle('x = 5 # comment\nx = 6\n') + self.assertInvalidSingle("c = '''\nd=1\n'''\na = 1\n\nb = 2\n") def test_particularly_evil_undecodable(self): # Issue 24022 |