summaryrefslogtreecommitdiff
path: root/Lib/test/test_symtable.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-06-18 13:56:16 +0300
committerSerhiy Storchaka <storchaka@gmail.com>2016-06-18 13:56:16 +0300
commitf95de0e8cc259b1ccb6b604a0ed74bb7894f4b2b (patch)
tree24ae043565544e6b02d39b127439b987b144d0d8 /Lib/test/test_symtable.py
parent2fec611a70ba862a4127b7656a6d98d48850c3af (diff)
parent9305d83425e2ec63b2769336907dd07b3151cd5f (diff)
downloadcpython-git-f95de0e8cc259b1ccb6b604a0ed74bb7894f4b2b.tar.gz
Issue #26754: PyUnicode_FSDecoder() accepted a filename argument encoded as
an iterable of integers. Now only strings and byte-like objects are accepted.
Diffstat (limited to 'Lib/test/test_symtable.py')
-rw-r--r--Lib/test/test_symtable.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_symtable.py b/Lib/test/test_symtable.py
index e5e7b83d21..c5d7facfdb 100644
--- a/Lib/test/test_symtable.py
+++ b/Lib/test/test_symtable.py
@@ -157,6 +157,12 @@ class SymtableTest(unittest.TestCase):
self.fail("no SyntaxError for %r" % (brokencode,))
checkfilename("def f(x): foo)(") # parse-time
checkfilename("def f(x): global x") # symtable-build-time
+ symtable.symtable("pass", b"spam", "exec")
+ with self.assertRaises(TypeError):
+ symtable.symtable("pass", bytearray(b"spam"), "exec")
+ symtable.symtable("pass", memoryview(b"spam"), "exec")
+ with self.assertRaises(TypeError):
+ symtable.symtable("pass", list(b"spam"), "exec")
def test_eval(self):
symbols = symtable.symtable("42", "?", "eval")