diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2014-04-15 14:11:09 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2014-04-15 14:11:09 -0400 |
commit | 0f0c892487277e25ce79a39477b193822f1edf79 (patch) | |
tree | 88c6e8d02d0f36fac8cebd1945970ea400db8d03 /setuptools/command/easy_install.py | |
parent | 48864fad436fcb2ca9f4832fbdabbb66d12b7610 (diff) | |
download | external_python_setuptools-0f0c892487277e25ce79a39477b193822f1edf79.tar.gz external_python_setuptools-0f0c892487277e25ce79a39477b193822f1edf79.tar.bz2 external_python_setuptools-0f0c892487277e25ce79a39477b193822f1edf79.zip |
Re-arrange _first_line_re to put core functionality at the top level
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): |