code: def _filter_build_errors(self, ext):
      try:
          yield
      except (CCompilerError, DistutilsError, CompileError) as e:
          if not ext.optional:
              raise
          self.warn(
              'building extension "%s" failed: %s' % (ext.name, e)
          )
  
imports: import contextlib
  import os
  import re
  import sys
  from distutils.core import Command
  from distutils.errors import *
  from distutils.sysconfig import customize_compiler, get_python_version
  from distutils.sysconfig import get_config_h_filename
  from distutils.dep_util import newer_group
  from distutils.extension import Extension
  from distutils.util import get_platform
  from distutils import log
  from site import USER_BASE
label_desc: Use image node_id 10 for calling the build_ext obj's underlying member method code with example usage: obj._filter_build_errors(ext) without return types