diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-06-18 13:53:36 +0300 |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-06-18 13:53:36 +0300 |
commit | 9305d83425e2ec63b2769336907dd07b3151cd5f (patch) | |
tree | af956a2eff3d5241bfa64dd3dc2890fb44896ada /Lib/test/test_symtable.py | |
parent | bae5d81f5d1f388aad48c2ce1aee8682b157e1bd (diff) | |
download | cpython-git-9305d83425e2ec63b2769336907dd07b3151cd5f.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.py | 6 |
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") |