X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=BaseTools%2FTests%2FCheckPythonSyntax.py;h=099920721f5a2cd38d4336f22ed5619feec7ffb9;hb=c1387446edbb05a11e2646e4184585d58d47a7d6;hp=61a048ad5d054b84c2be68c08fb231cdb3cc320b;hpb=f51461c829c124288a930829a78e2a5a799f4039;p=mirror_edk2.git diff --git a/BaseTools/Tests/CheckPythonSyntax.py b/BaseTools/Tests/CheckPythonSyntax.py index 61a048ad5d..099920721f 100644 --- a/BaseTools/Tests/CheckPythonSyntax.py +++ b/BaseTools/Tests/CheckPythonSyntax.py @@ -1,15 +1,9 @@ ## @file # Unit tests for checking syntax of Python source code # -# Copyright (c) 2009, Intel Corporation. All rights reserved.
+# Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
# -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# SPDX-License-Identifier: BSD-2-Clause-Patent # ## @@ -29,7 +23,7 @@ class Tests(TestTools.BaseToolsTest): def SingleFileTest(self, filename): try: py_compile.compile(filename, doraise=True) - except Exception, e: + except Exception as e: self.fail('syntax error: %s, Error is %s' % (filename, str(e))) def MakePythonSyntaxCheckTests(): @@ -55,7 +49,7 @@ def MakePythonSyntaxCheckTests(): newmethod = lambda self: self.SingleFileTest(filename) setattr( Tests, - test, + test, newmethod )