class_docstr: Concrete class that implements an interface to Microsoft Visual C++,
  as defined by the CCompiler abstract class.
docstr: Discovered in pypa/distutils#15, some tools monkeypatch the compiler,
  so the 'env' kwarg causes a TypeError. Detect this condition and
  restore the legacy, unsafe behavior.
docstr_tok: ["Discovered","in","pypa\/distutils","#","15",",","some","tools","monkeypatch","the","compiler",",","so","the","'env","'","kwarg","causes","a","TypeError",".","Detect","this","condition","and","restore","the","legacy",",","unsafe","behavior","."]
code: def _fallback_spawn(self, cmd, env):
      """
      Discovered in pypa/distutils#15, some tools monkeypatch the compiler,
      so the 'env' kwarg causes a TypeError. Detect this condition and
      restore the legacy, unsafe behavior.
      """
      bag = type("Bag", (), {})()
      try:
          yield bag
      except TypeError as exc:
          if "unexpected keyword argument 'env'" not in str(exc):
              raise
      else:
          return
      warnings.warn(
          "Fallback spawn triggered. Please update distutils monkeypatch."
      )
      with mock.patch.dict("os.environ", env):
          bag.value = super().spawn(cmd)
  
imports: import os
  import subprocess
  import contextlib
  import warnings
  import unittest.mock
  from .errors import DistutilsExecError, DistutilsPlatformError, CompileError, LibError, LinkError
  from .ccompiler import CCompiler, gen_lib_options
  from ._log import log
  from .util import get_platform
  from itertools import count
label_desc: Use image node_id 10 for calling the MSVCCompiler obj's underlying member method code with example usage: obj._fallback_spawn(cmd, env) without return types