@@ -55,7 +55,11 @@ def select_n(message, selections):
5555
5656 for index , selection in enumerate (selections ):
5757 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+ }
5963 )
6064 return prompt .options (message , options )
6165
@@ -66,9 +70,11 @@ def run_command(self, cmd, suppress_message=False, return_output=False):
6670 original_stdout = sys .stdout
6771 original_stderr = sys .stderr
6872 try :
73+ # pylint: disable=consider-using-with
6974 proc = subprocess .Popen (
7075 cmd , shell = True , stdout = subprocess .PIPE , stderr = subprocess .PIPE
7176 )
77+ # pylint: enable=consider-using-with
7278 full_output = ""
7379 while True :
7480 output = proc .stdout .readline ()
@@ -391,9 +397,8 @@ def write_text_file(self, path, content, append=True):
391397 content = "\n " + content
392398 else :
393399 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 )
397402
398403 @staticmethod
399404 def is_python3 ():
0 commit comments