From d95bfbded2466bb6ea796254f3f271a73505993b Mon Sep 17 00:00:00 2001 From: Ryan Beasley Date: Fri, 1 May 2020 12:16:34 -0700 Subject: [PATCH] Reintroduce support for Python 2.6 to python_stub_template Commit d5012a7ed19c1e75e413373fa22c5f1b08a9ee29 introduced a Python 2.7 dependency into python_stub_template.txt. Unfortunately this stub is non-hermetic, so even if the user has configured Python 2.7 and 3 `py_runtime`s, their builds may fail if the system-provided Python is ancient (ex: CentOS 6.6 provides Python 2.6.6). Accommodate ancient Python by reworking the path deduplication in terms of a `set` and a generator instead of `collections.OrderedDict`. Workaround for #11265. Testing Done: - `bazelisk test //src/test/shell/integration:python_stub_test` - In a CentOS 6.6 env: ```console $ /usr/bin/env python -V Python 2.6.6 $ cat >test.py <BUILD <