a9997c4d89d66022d86532101a56366e4a81cf3f,src/python/pants/backend/python/tasks/python_task.py,PythonTask,__init__,#PythonTask#Any#Any#,24

Before Change



    self.interpreter_cache = PythonInterpreterCache(self.context.config,
                                                    logger=self.context.log.debug)
    interpreters = self.context.options.python_interpreters or [b""]
    self.interpreter_cache.setup(filters=interpreters)
    interpreters = self.interpreter_cache.select_interpreter(
      list(self.interpreter_cache.matches(interpreters)))
    if len(interpreters) != 1:
      raise TaskError("Unable to detect suitable interpreter.")
    else:
      self.context.log.debug("Selected %s" % interpreters[0])
    self._interpreter = interpreters[0]

  @property
  def interpreter(self):
    return self._interpreter

After Change


    super(PythonTask, self).__init__(context, workdir)
    self.conn_timeout = (self.context.options.python_conn_timeout or
                         self.context.config.getdefault("connection_timeout"))
    compatibilities = self.context.options.interpreter or [b""]

    self.interpreter_cache = PythonInterpreterCache(self.context.config,
                                                    logger=self.context.log.debug)
    // We pass in filters=compatibilities because setting up some python versions
    // (e.g., 3<=python<3.3) crashes, and this gives us an escape hatch.
    self.interpreter_cache.setup(filters=compatibilities)

    // Select a default interpreter to use.
    self._interpreter = self.select_interpreter(compatibilities)

  @property
  def interpreter(self):
    Subclasses can use this if they"re fine with the default interpreter (the usual case).
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 26

Instances


Project Name: pantsbuild/pants
Commit Name: a9997c4d89d66022d86532101a56366e4a81cf3f
Time: 2014-06-12
Author: benjy@foursquare.com
File Name: src/python/pants/backend/python/tasks/python_task.py
Class Name: PythonTask
Method Name: __init__


Project Name: pantsbuild/pants
Commit Name: a9997c4d89d66022d86532101a56366e4a81cf3f
Time: 2014-06-12
Author: benjy@foursquare.com
File Name: src/python/pants/backend/python/tasks/python_task.py
Class Name: PythonTask
Method Name: __init__


Project Name: pantsbuild/pants
Commit Name: 2857a81804c7587bea0da209a4e43c689f8cec53
Time: 2014-06-12
Author: benjy@foursquare.com
File Name: src/python/pants/backend/python/tasks/python_task.py
Class Name: PythonTask
Method Name: __init__


Project Name: pantsbuild/pants
Commit Name: be65d80d1e7f573e447608d6fc8e3e395adc3957
Time: 2014-06-12
Author: benjy@foursquare.com
File Name: src/python/pants/backend/python/tasks/python_task.py
Class Name: PythonTask
Method Name: __init__