X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=BaseTools%2FSource%2FPython%2Fbuild%2Fbuild.py;h=4600c46be1beca44bb3ab33b55404f24904636df;hp=c16e810fed714e11b5aad1abc80f8cdb0086d5d7;hb=5b0671c1e514e534c6d5be9604da33bfc2cd0a24;hpb=00eb12a2c768cae3ca136110baacb5a35e9066a8 diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Python/build/build.py index c16e810fed..4600c46be1 100644 --- a/BaseTools/Source/Python/build/build.py +++ b/BaseTools/Source/Python/build/build.py @@ -548,7 +548,7 @@ class BuildTask: EdkLogger.debug(EdkLogger.DEBUG_8, "Threads [%s]" % ", ".join(Th.getName() for Th in threading.enumerate())) # avoid tense loop time.sleep(0.1) - except BaseException, X: + except BaseException as X: # # TRICK: hide the output of threads left runing, so that the user can # catch the error message easily @@ -1324,7 +1324,7 @@ class Build(): try: #os.rmdir(AutoGenObject.BuildDir) RemoveDirectory(AutoGenObject.BuildDir, True) - except WindowsError, X: + except WindowsError as X: EdkLogger.error("build", FILE_DELETE_FAILURE, ExtraData=str(X)) return True @@ -1414,7 +1414,7 @@ class Build(): try: #os.rmdir(AutoGenObject.BuildDir) RemoveDirectory(AutoGenObject.BuildDir, True) - except WindowsError, X: + except WindowsError as X: EdkLogger.error("build", FILE_DELETE_FAILURE, ExtraData=str(X)) return True @@ -2500,14 +2500,14 @@ def Main(): # All job done, no error found and no exception raised # BuildError = False - except FatalError, X: + except FatalError as X: if MyBuild is not None: # for multi-thread build exits safely MyBuild.Relinquish() if Option is not None and Option.debug is not None: EdkLogger.quiet("(Python %s on %s) " % (platform.python_version(), sys.platform) + traceback.format_exc()) ReturnCode = X.args[0] - except Warning, X: + except Warning as X: # error from Fdf parser if MyBuild is not None: # for multi-thread build exits safely