2
2
3
3
Implements the Distutils 'build_scripts' command."""
4
4
5
- import os , re
5
+ import os
6
+ import re
6
7
from stat import ST_MODE
7
8
from distutils import sysconfig
8
9
from distutils .core import Command
14
15
# check if Python is called on the first line with this expression
15
16
first_line_re = re .compile (b'^#!.*python[0-9.]*([ \t ].*)?$' )
16
17
18
+
17
19
class build_scripts (Command ):
18
20
19
21
description = "\" build\" scripts (copy and fixup #! line)"
@@ -26,7 +28,6 @@ class build_scripts(Command):
26
28
27
29
boolean_options = ['force' ]
28
30
29
-
30
31
def initialize_options (self ):
31
32
self .build_dir = None
32
33
self .scripts = None
@@ -49,7 +50,6 @@ def run(self):
49
50
return
50
51
self .copy_scripts ()
51
52
52
-
53
53
def copy_scripts (self ):
54
54
r"""Copy each script listed in 'self.scripts'; if it's marked as a
55
55
Python script in the Unix way (first line matches 'first_line_re',
@@ -101,8 +101,9 @@ def copy_scripts(self):
101
101
else :
102
102
executable = os .path .join (
103
103
sysconfig .get_config_var ("BINDIR" ),
104
- "python%s%s" % (sysconfig .get_config_var ("VERSION" ),
105
- sysconfig .get_config_var ("EXE" )))
104
+ "python%s%s" % (
105
+ sysconfig .get_config_var ("VERSION" ),
106
+ sysconfig .get_config_var ("EXE" )))
106
107
executable = os .fsencode (executable )
107
108
shebang = b"#!" + executable + post_interp + b"\n "
108
109
# Python parser starts to read a script using UTF-8 until
0 commit comments