code: def test_exc_info(self):
      raised_exception = ValueError("5")
      new_exc = TypeError("TEST")
      try:
          raise raised_exception
      except ValueError as e:
          tb = e.__traceback__
          orig_sys_exc_info = sys.exc_info()
          orig_exc_info = _testcapi.set_exc_info(
              new_exc.__class__, new_exc, None
          )
          new_sys_exc_info = sys.exc_info()
          new_exc_info = _testcapi.set_exc_info(*orig_exc_info)
          reset_sys_exc_info = sys.exc_info()
  
          self.assertEqual(orig_exc_info[1], e)
  
          self.assertSequenceEqual(
              orig_exc_info,
              (raised_exception.__class__, raised_exception, tb),
          )
          self.assertSequenceEqual(orig_sys_exc_info, orig_exc_info)
          self.assertSequenceEqual(reset_sys_exc_info, orig_exc_info)
          self.assertSequenceEqual(
              new_exc_info, (new_exc.__class__, new_exc, None)
          )
          self.assertSequenceEqual(new_sys_exc_info, new_exc_info)
      else:
          self.assertTrue(False)
  
imports: import errno
  import os
  import re
  import sys
  import unittest
  from test import support
  from test.support import import_helper
  from test.support.os_helper import TESTFN, TESTFN_UNDECODABLE
  from test.support.script_helper import assert_python_failure
  from test.support.testcase import ExceptionIsLikeMixin
  from .test_misc import decode_stderr
label_desc: Use image node_id 2 for calling the Test_Exceptions obj's underlying member method code with example usage: obj.test_exc_info() without return types