From b16cf407dcbbfab0df079e894819ea5dce166b48 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 27 Mar 2022 10:20:24 -0400 Subject: =?UTF-8?q?=F0=9F=91=B9=20Feed=20the=20hobgoblins=20(delint).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- distutils/command/build_scripts.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/distutils/command/build_scripts.py b/distutils/command/build_scripts.py index e3312cf0..dbeef2dd 100644 --- a/distutils/command/build_scripts.py +++ b/distutils/command/build_scripts.py @@ -2,7 +2,8 @@ Implements the Distutils 'build_scripts' command.""" -import os, re +import os +import re from stat import ST_MODE from distutils import sysconfig from distutils.core import Command @@ -14,6 +15,7 @@ import tokenize # check if Python is called on the first line with this expression first_line_re = re.compile(b'^#!.*python[0-9.]*([ \t].*)?$') + class build_scripts(Command): description = "\"build\" scripts (copy and fixup #! line)" @@ -26,7 +28,6 @@ class build_scripts(Command): boolean_options = ['force'] - def initialize_options(self): self.build_dir = None self.scripts = None @@ -49,7 +50,6 @@ class build_scripts(Command): return self.copy_scripts() - def copy_scripts(self): r"""Copy each script listed in 'self.scripts'; if it's marked as a Python script in the Unix way (first line matches 'first_line_re', @@ -101,8 +101,9 @@ class build_scripts(Command): else: executable = os.path.join( sysconfig.get_config_var("BINDIR"), - "python%s%s" % (sysconfig.get_config_var("VERSION"), - sysconfig.get_config_var("EXE"))) + "python%s%s" % ( + sysconfig.get_config_var("VERSION"), + sysconfig.get_config_var("EXE"))) executable = os.fsencode(executable) shebang = b"#!" + executable + post_interp + b"\n" # Python parser starts to read a script using UTF-8 until -- cgit v1.2.1