X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=BaseTools%2FSource%2FPython%2FCommon%2FExpression.py;h=51e8d2174a8ff2352a342835fb2a140c6349f571;hb=39456d00f36e04b7e7efb208f350f4e83b6c3531;hp=e1a2c155b7f3d94afa62997413d8a1f6f6b43480;hpb=0d1f5b2b5dc3c1cf381be0a1ec8f960dc6029a93;p=mirror_edk2.git diff --git a/BaseTools/Source/Python/Common/Expression.py b/BaseTools/Source/Python/Common/Expression.py index e1a2c155b7..51e8d2174a 100644 --- a/BaseTools/Source/Python/Common/Expression.py +++ b/BaseTools/Source/Python/Common/Expression.py @@ -20,6 +20,7 @@ from Misc import GuidStringToGuidStructureString, ParseFieldValue, IsFieldValueA import Common.EdkLogger as EdkLogger import copy from Common.DataType import * +import sys ERR_STRING_EXPR = 'This operator cannot be used in string expression: [%s].' ERR_SNYTAX = 'Syntax error, the rest of expression cannot be evaluated: [%s].' @@ -254,7 +255,8 @@ class ValueExpression(BaseExpression): Oprand2 = IntToStr(Oprand2) TypeDict = { type(0) : 0, - type(0L) : 0, + # For python2 long type + type(sys.maxsize + 1) : 0, type('') : 1, type(True) : 2 } @@ -892,7 +894,7 @@ class ValueExpressionEx(ValueExpression): raise BadExpression('Type %s PCD Value Size is Larger than 8 byte' % self.PcdType) else: try: - TmpValue = long(PcdValue) + TmpValue = int(PcdValue) TmpList = [] if TmpValue.bit_length() == 0: PcdValue = '{0x00}'