Browse Source

Do with/as when opening ACC's process, just in case

ijon 3 years ago
parent
commit
b45e8f7dbf
1 changed files with 3 additions and 4 deletions
  1. 3 4
      make.py

+ 3 - 4
make.py

@@ -139,10 +139,9 @@ def acc_buildObjects(src, hdr, obj, exe=EXE_ACC, recompile=False):
         if lastHadOutput: print()
         print(printCommand(command))
         
-        process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True)
-        
-        output, errors = process.communicate()
-        exitCode       = process.returncode
+        with subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True) as process:        
+            output, errors = process.communicate()
+            exitCode       = process.returncode
         
         # hacks
         if "Host byte order:" in output: