diff options
Diffstat (limited to 'setuptools/command/easy_install.py')
-rwxr-xr-x | setuptools/command/easy_install.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index 5206698f..de139f2f 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -1530,11 +1530,15 @@ class PthDistributions(Environment): def _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): - return re.compile(first_line_re.pattern.decode()) + """ + Return a regular expression based on first_line_re suitable for matching + strings. + """ + if isinstance(first_line_re.pattern, str): + return first_line_re - return first_line_re + # first_line_re in Python >=3.1.4 and >=3.2.1 is a bytes pattern. + return re.compile(first_line_re.pattern.decode()) def get_script_header(script_text, executable=sys_executable, wininst=False): |