def createPythonExtensionBuilder(env):
 try:
  pyext = env['BUILDERS']['PythonExtension']
 except KeyError:
  import SCons.Action
  import SCons.Defaults
  action = SCons.Action.Action('$PYEXTLINKCOM', '$PYEXTLINKCOMSTR')
  action_list = [SCons.Defaults.SharedCheck, action]
  pyext = SCons.Builder.Builder(action=action_list, emitter='$SHLIBEMITTER', prefix='$PYEXTPREFIX', suffix='$PYEXTSUFFIX', target_scanner=ProgramScanner, src_suffix='$PYEXTOBJSUFFIX', src_builder='PythonObject')
  env['BUILDERS']['PythonExtension'] = pyext
 return pyext

def createPythonExtensionBuilder ( env ) : try : pyext = env [ 'BUILDERS' ] [ 'PythonExtension' ] except KeyError : import SCons . Action import SCons . Defaults action = SCons . Action . Action ( '$PYEXTLINKCOM' , '$PYEXTLINKCOMSTR' ) action_list = [ SCons . Defaults . SharedCheck , action ] pyext = SCons . Builder . Builder ( action = action_list , emitter = '$SHLIBEMITTER' , prefix = '$PYEXTPREFIX' , suffix = '$PYEXTSUFFIX' , target_scanner = ProgramScanner , src_suffix = '$PYEXTOBJSUFFIX' , src_builder = 'PythonObject' ) env [ 'BUILDERS' ] [ 'PythonExtension' ] = pyext return pyext
this is a utility function that creates the pythonextension builder in an environment if it is not there already .