mirror of
https://github.com/python/cpython.git
synced 2025-10-09 08:31:26 +00:00
Issue #26754: Undocumented support of general bytes-like objects
as path in compile() and similar functions is now deprecated.
This commit is contained in:
parent
d73c31899e
commit
febc332056
7 changed files with 34 additions and 16 deletions
|
@ -158,9 +158,11 @@ class SymtableTest(unittest.TestCase):
|
|||
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):
|
||||
with self.assertWarns(DeprecationWarning), \
|
||||
self.assertRaises(TypeError):
|
||||
symtable.symtable("pass", bytearray(b"spam"), "exec")
|
||||
symtable.symtable("pass", memoryview(b"spam"), "exec")
|
||||
with self.assertWarns(DeprecationWarning):
|
||||
symtable.symtable("pass", memoryview(b"spam"), "exec")
|
||||
with self.assertRaises(TypeError):
|
||||
symtable.symtable("pass", list(b"spam"), "exec")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue