code: def test_sys_getobject(self):
      # Test PySys_GetObject()
      getobject = _testcapi.sys_getobject
  
      self.assertIs(getobject(b"stdout"), sys.stdout)
      with support.swap_attr(sys, "\U0001f40d", 42):
          self.assertEqual(getobject("\U0001f40d".encode()), 42)
  
      self.assertIs(getobject(b"nonexisting"), AttributeError)
      with support.catch_unraisable_exception() as cm:
          self.assertIs(getobject(b"\xff"), AttributeError)
          self.assertEqual(cm.unraisable.exc_type, UnicodeDecodeError)
          self.assertRegex(
              str(cm.unraisable.exc_value), "'utf-8' codec can't decode"
          )
  
file_path: cpython/Lib/test/test_capi/test_sys.py
imports: import unittest
  import contextlib
  import sys
  from test import support
  from test.support import import_helper
label_desc: Use image node_id 1 for calling the CAPITest obj's underlying member method code with example usage: obj.test_sys_getobject() without return types