772005bad6a61109b9bec4d5614b8048bef17178,src/python/pants/util/eval.py,,parse_expression,#Any#Any#Any#Any#,8

Before Change


        raise ValueError("The given acceptable_types is not a valid type (tuple): {}"
                         .format(acceptable_types))

    raise raise_type(dedent(\
      The {name} is not of the expected type(s): {types}:
      Given the following raw value that evaluated to type {type}:
      {value}
      .format(name=get_name(),
                 types=", ".join(format_type(t) for t in iter_types(acceptable_types)),
                 type=format_type(type(parsed_value)),
                 value=format_raw_value())))
  return parsed_value

After Change


    parsed_value = eval(val)
  except Exception as e:
    raise raise_type(
      dedent(
        f\
        The {get_name()} cannot be evaluated as a literal expression: {e!r}
        Given raw value:
        {format_raw_value()}
        
      )
    )

  if not isinstance(parsed_value, acceptable_types):
    def iter_types(types):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: pantsbuild/pants
Commit Name: 772005bad6a61109b9bec4d5614b8048bef17178
Time: 2020-01-24
Author: ericarellano@me.com
File Name: src/python/pants/util/eval.py
Class Name:
Method Name: parse_expression


Project Name: pantsbuild/pants
Commit Name: 79ba58636288f95be1a156f02623d46b0eb242ea
Time: 2019-09-07
Author: ericarellano@me.com
File Name: src/python/pants/core_tasks/generate_pants_ini.py
Class Name: GeneratePantsIni
Method Name: console_output


Project Name: pantsbuild/pants
Commit Name: 096b135b0b19f9425d97b1f77afb521f5b8584b5
Time: 2019-05-15
Author: 1305167+cosmicexplorer@users.noreply.github.com
File Name: src/python/pants/backend/python/subsystems/python_native_code.py
Class Name: PythonNativeCode
Method Name: check_build_for_current_platform_only