use #!/usr/bin/python everywhere

None of these files are directly executable (they're all wrapped)
which is probably why no one noticed a runtime issue.

Down with the 2.6 interlopers!

BUG=None
TEST=`./buildbot/run_tests` passes on my python-2.7 system

Change-Id: Ia9e78fd564772517b31f98a15010e565c43c9d21
Reviewed-on: https://gerrit.chromium.org/gerrit/45333
Reviewed-by: Matt Tennant <mtennant@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
parallel_emerge: update emerge package api

Upstream has deprecated the .metadata member.

BUG=chromium:218085
TEST=paladin and full builds work on both the old and new versions of portage

Change-Id: I30e8ac38dbea787f126ecead2264262bb092c61b
Reviewed-on: https://gerrit.chromium.org/gerrit/43527
Reviewed-by: Matt Tennant <mtennant@chromium.org>
Commit-Queue: David James <davidjames@chromium.org>
Tested-by: David James <davidjames@chromium.org>
Set close_fds=False in setup_fds.

I originally set close_fds=True here because I was looking to prevent
locks from bleeding into subprocesses. close_fds=True closes all file
descriptors except for the named file descriptors. This logic is no
longer necessary in new versions of Portage because Portage has added
its own logic for preventing bleeding locks.

close_fds=True is also a maintenance headache and causes issues with new
versions of Portage:

 ...
   File .../_emerge/PipeReader.py, line 42, in _start
     self._registered_events, output_handler))
   File .../portage/util/_eventloop/EventLoop.py, line 512, in io_add_watch
     self._poll_obj.register(f, condition)
   File  .../portage/util/_eventloop/EventLoop.py, line 633, in register
     self._epoll_obj.register(fd, *args)
 IOError: [Errno 22] Invalid argument

In older versions of Portage, the close_fds argument was not available,
so I've added a version check here.

BUG=chromium:218085
TEST=Many mario-paladin trybot runs.

Change-Id: I5ad83b4571eb6c00b15e2771a6287d4eb7ac79c5
Reviewed-on: https://gerrit.chromium.org/gerrit/62736
Commit-Queue: David James <davidjames@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: David James <davidjames@chromium.org>
Merge pull request #11 from marineam/emerge

Emerge updates