setup.py: handle --use-env-python for Python3
commit69c9ca3494bf2591a65110d50bbf38ee4d4cd1f1
authorDavid Aguilar <davvid@gmail.com>
Sun, 22 Nov 2020 20:15:31 +0000 (22 12:15 -0800)
committerDavid Aguilar <davvid@gmail.com>
Sun, 22 Nov 2020 20:19:59 +0000 (22 12:19 -0800)
treeb5eebdc58d6784d4c24d0d0d33b69fd5e403f925
parent22c8838cf36fdcbba8f4c92a63a7a9f047cc8a57
setup.py: handle --use-env-python for Python3

Python3 requires that regex patterns that match bytes must be specified
using a bytes pattern.  The first_line_re is used to detect the Python
shebang lines, and Python3 reads files as bytes, so special-case the
pattern used on Python3.

Python2 accepts the unicode r"string literal" pattern when matching
against bytes.  Leave that code path as-is.

Closes #1102
Reported-by: David Roman <davidroman96@gmail.com>
Signed-off-by: David Aguilar <davvid@gmail.com>
CHANGES.rst
setup.py