code: def _try_compile_deployment_target(self, operator, target):
      orig_environ = os.environ
      os.environ = orig_environ.copy()
      self.addCleanup(setattr, os, "environ", orig_environ)
  
      if target is None:
          if os.environ.get("MACOSX_DEPLOYMENT_TARGET"):
              del os.environ["MACOSX_DEPLOYMENT_TARGET"]
      else:
          os.environ["MACOSX_DEPLOYMENT_TARGET"] = target
  
      deptarget_c = os.path.join(self.tmp_dir, "deptargetmodule.c")
  
      with open(deptarget_c, "w") as fp:
          fp.write(
              textwrap.dedent(
                  """\
                  #include <AvailabilityMacros.h>
  
                  int dummy;
  
                  #if TARGET %s MAC_OS_X_VERSION_MIN_REQUIRED
                  #else
                  #error "Unexpected target"
                  #endif
  
              """
                  % operator
              )
          )
  
      # get the deployment target that the interpreter was built with
      target = sysconfig.get_config_var("MACOSX_DEPLOYMENT_TARGET")
      target = tuple(map(int, target.split(".")[0:2]))
      # format the target value as defined in the Apple
      # Availability Macros.  We can't use the macro names since
      # at least one value we test with will not exist yet.
      if target[1] < 10:
          # for 10.1 through 10.9.x -> "10n0"
          target = "%02d%01d0" % target
      else:
          # for 10.10 and beyond -> "10nn00"
          target = "%02d%02d00" % target
      deptarget_ext = Extension(
          "deptarget",
          [deptarget_c],
          extra_compile_args=["-DTARGET=%s" % (target,)],
      )
      dist = Distribution(
          {"name": "deptarget", "ext_modules": [deptarget_ext]}
      )
      dist.package_dir = self.tmp_dir
      cmd = build_ext(dist)
      cmd.build_lib = self.tmp_dir
      cmd.build_temp = self.tmp_dir
  
      try:
          cmd.ensure_finalized()
          cmd.run()
      except CompileError:
          self.fail("Wrong deployment target during compilation")
  
imports: import sys
  import os
  from StringIO import StringIO
  import textwrap
  from distutils.core import Extension, Distribution
  from distutils.command.build_ext import build_ext
  from distutils import sysconfig
  from distutils.tests import support
  from distutils.errors import DistutilsSetupError, CompileError, DistutilsPlatformError
  import unittest
  from test import test_support
label_desc: Use image node_id 19 for calling the BuildExtTestCase obj's underlying member method code with example usage: obj._try_compile_deployment_target(operator, target) without return types