summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/UPT/Library/CommentParsing.py
diff options
context:
space:
mode:
Diffstat (limited to 'BaseTools/Source/Python/UPT/Library/CommentParsing.py')
-rw-r--r--BaseTools/Source/Python/UPT/Library/CommentParsing.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/BaseTools/Source/Python/UPT/Library/CommentParsing.py b/BaseTools/Source/Python/UPT/Library/CommentParsing.py
index 8f9fec7595..285812c9c2 100644
--- a/BaseTools/Source/Python/UPT/Library/CommentParsing.py
+++ b/BaseTools/Source/Python/UPT/Library/CommentParsing.py
@@ -74,7 +74,7 @@ def ParseHeaderCommentSection(CommentList, FileName = None, IsBinaryHeader = Fal
# first find the last copyright line
#
Last = 0
- for Index in range(len(CommentList)-1, 0, -1):
+ for Index in xrange(len(CommentList)-1, 0, -1):
Line = CommentList[Index][0]
if _IsCopyrightLine(Line):
Last = Index
@@ -206,14 +206,17 @@ def ParsePcdErrorCode (Value = None, ContainerFile = None, LineNum = None):
Base = 16
else:
Base = 10
- ErrorCode = int(Value, Base)
+ ErrorCode = long(Value, Base)
if ErrorCode > PCD_ERR_CODE_MAX_SIZE or ErrorCode < 0:
Logger.Error('Parser',
FORMAT_NOT_SUPPORTED,
"The format %s of ErrorCode is not valid, should be UNIT32 type or long type" % Value,
File = ContainerFile,
Line = LineNum)
- return hex(ErrorCode)
+ #
+ # To delete the tailing 'L'
+ #
+ return hex(ErrorCode)[:-1]
except ValueError as XStr:
if XStr:
pass