def test_sys_intern(self):
"""
Py2's builtin intern() has been moved to the sys module. Tests
whether sys.intern is available.
"""
from sys import intern
if utils.PY3:
self.assertEqual(intern('hello'), 'hello')
else:
# intern() requires byte-strings on Py2:
self.assertEqual(intern(b'hello'), b'hello')
评论列表
文章目录