Support Python >=3.1.4 and >=3.2.1.

Type of distutils.command.build_scripts.first_line_re has been changed by
the fix for http://bugs.python.org/issue10419.

--HG--
branch : distribute
extra : rebase_source : cd656cab87ff4f912ce5146b96e841b4eb17c49d
parent dba705d9
......@@ -2,6 +2,12 @@
CHANGES
=======
------
0.6.17
------
* Support Python >=3.1.4 and >=3.2.1.
------
0.6.16
------
......
......@@ -1590,6 +1590,11 @@ class PthDistributions(Environment):
def get_script_header(script_text, executable=sys_executable, wininst=False):
"""Create a #! line, getting options (if any) from script_text"""
from distutils.command.build_scripts import first_line_re
# first_line_re in Python >=3.1.4 and >=3.2.1 is a bytes pattern.
if not isinstance(first_line_re.pattern, str):
first_line_re = re.compile(first_line_re.pattern.decode())
first = (script_text+'\n').splitlines()[0]
match = first_line_re.match(first)
options = ''
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment