@@ -55,7 +55,11 @@ def select_n(message, selections):
55
55
56
56
for index , selection in enumerate (selections ):
57
57
options .append (
58
- {"selector" : str (index + 1 ), "prompt" : selection , "return" : index + 1 ,}
58
+ {
59
+ "selector" : str (index + 1 ),
60
+ "prompt" : selection ,
61
+ "return" : index + 1 ,
62
+ }
59
63
)
60
64
return prompt .options (message , options )
61
65
@@ -66,9 +70,11 @@ def run_command(self, cmd, suppress_message=False, return_output=False):
66
70
original_stdout = sys .stdout
67
71
original_stderr = sys .stderr
68
72
try :
73
+ # pylint: disable=consider-using-with
69
74
proc = subprocess .Popen (
70
75
cmd , shell = True , stdout = subprocess .PIPE , stderr = subprocess .PIPE
71
76
)
77
+ # pylint: enable=consider-using-with
72
78
full_output = ""
73
79
while True :
74
80
output = proc .stdout .readline ()
@@ -391,9 +397,8 @@ def write_text_file(self, path, content, append=True):
391
397
content = "\n " + content
392
398
else :
393
399
mode = "w"
394
- service_file = open (self .path (path ), mode )
395
- service_file .write (content )
396
- service_file .close ()
400
+ with open (self .path (path ), mode ) as service_file :
401
+ service_file .write (content )
397
402
398
403
@staticmethod
399
404
def is_python3 ():
0 commit comments