mirror of https://github.com/python/cpython
Fix test_funcattrs.py: __name__ attribute must be str8.
This commit is contained in:
parent
305b9246a7
commit
2565d90dd7
|
@ -258,8 +258,8 @@ def test_func_globals():
|
|||
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…
Reference in New Issue