Commits

Jason R. Coombs committed a3d16c5

Re-arrange _first_line_re to put core functionality at the top level

  • Participants
  • Parent commits c327244

Comments (0)

Files changed (1)

File setuptools/command/easy_install.py

 
 
 def _first_line_re():
+    """
+    Return a regular expression based on first_line_re suitable for matching
+    strings.
+    """
+    if isinstance(first_line_re.pattern, str):
+        return 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 first_line_re
+    return re.compile(first_line_re.pattern.decode())
 
 
 def get_script_header(script_text, executable=sys_executable, wininst=False):