Skip to content

Commit 442d4f2

Browse files
committed
Remove use_bytes from test_capi.test_sys
1 parent 2231e0a commit 442d4f2

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

Lib/test/test_capi/test_sys.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,11 @@ class CAPITest(unittest.TestCase):
1818

1919
maxDiff = None
2020

21-
def check_sys_getattr_common(self, sys_getattr, use_bytes=True):
21+
def check_sys_getattr_common(self, sys_getattr):
2222
self.assertIs(sys_getattr('stdout'), sys.stdout)
2323

24-
name = '\U0001f40d'
25-
with support.swap_attr(sys, name, 42):
26-
key = (name.encode() if use_bytes else name)
27-
self.assertEqual(sys_getattr(key), 42)
24+
with support.swap_attr(sys, '\U0001f40d', 42):
25+
self.assertEqual(sys_getattr('\U0001f40d'), 42)
2826

2927
@support.cpython_only
3028
def test_sys_getobject(self):
@@ -42,7 +40,7 @@ def test_sys_getobject(self):
4240
# CRASHES getobject(NULL)
4341

4442
def check_sys_getattr(self, sys_getattr):
45-
self.check_sys_getattr_common(sys_getattr, use_bytes=False)
43+
self.check_sys_getattr_common(sys_getattr)
4644

4745
with self.assertRaises(AttributeError):
4846
sys_getattr(b'nonexisting')

0 commit comments

Comments
 (0)