From c2520e2d34b0139205471d0c6867393d15fb5d6a Mon Sep 17 00:00:00 2001 From: Arfrever Frehtes Taifersar Arahesis Date: Wed, 11 May 2011 19:06:35 +0200 Subject: 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 --- setuptools/command/easy_install.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'setuptools') diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index fb0f9979..58e7ab39 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -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 = '' -- cgit v1.2.3