mirror of
https://github.com/python/cpython.git
synced 2026-01-06 07:22:09 +00:00
Fix test_funcattrs.py: __name__ attribute must be str8.
This commit is contained in:
parent
305b9246a7
commit
2565d90dd7
1 changed files with 2 additions and 2 deletions
|
|
@ -258,8 +258,8 @@ def f(): pass
|
|||
def test_func_name():
|
||||
def f(): pass
|
||||
verify(f.__name__ == "f")
|
||||
f.__name__ = "g"
|
||||
verify(f.__name__ == "g")
|
||||
f.__name__ = str8("g")
|
||||
verify(f.__name__ == str8("g"))
|
||||
cantset(f, "__globals__", 1)
|
||||
cantset(f, "__name__", 1)
|
||||
# test that you can access func.__name__ in restricted mode
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue