human
Solve the following python programming problem given the following code:
def buildImportFromNode(provider, node, source_ref) : 
    module_name = (node.module if (node.module is not None) else '') 
    level = node.level 
    if (module_name == '__future__') : 
        if (not provider.isCompiledPythonModule ()) : 
            SyntaxErrors.raiseSyntaxError (reason = 'from __future__ imports must occur at the beginning of the file', col_offset = (8 if ((python_version >= 300) or (not Options.isFullCompat ())) else None), source_ref = source_ref) 
for import_desc in node.names : 
            (object_name, _local_name) = (import_desc.name, import_desc.asname) 
            enableFutureFeature (object_name = object_name, future_spec = source_ref.getFutureSpec (), source_ref = source_ref) 
node.source_ref = source_ref 
        _future_import_nodes.append (node) 
target_names = [] 
    import_names = [] 
    for import_desc in node.names : 
        (object_name, local_name) = (import_desc.name, import_desc.asname) 
        if (object_name == '*') : 
            target_names.append (None) 
else : 
            target_names.append ((local_name if (source_ref is not None) else object_name)) 
import_names.append (object_name) 
if (None in target_names) : 
        assert (target_names == [None]) 
        if ((not provider.isCompiledPythonModule ()) and (python_version >= 300)) : 
            SyntaxErrors.raiseSyntaxError ('import * only allowed at module level', provider.getSourceReference ()) 
if provider.isExpressionFunctionBody () : 
            provider.markAsStarImportContaining () 
return StatementImportStar (module_import = ExpressionImportModule (module_name = module_name, import_list = ('*',), level = level, source_ref = source_ref), source_ref = source_ref) 
else : 
        def makeImportName(import_name) : 
            if (module_name == '__future__') : 
                return ExpressionImportModuleHard (module_name = '__future__', import_name = import_name, source_ref = source_ref) 
else : 
                return ExpressionImportName (module = ExpressionImportModule (module_name =...

    
    

    Fix the buggy line: target_names.append ((local_name if (source_ref is not None) else object_name))
assistant
#Here is Python code to fix the buggy line: target_names.

target_names.append ((local_name if (local_name is not None) else object_name))