BaseTools:Similar to octal data rectification

In python3, if Value is octal data, the int(Value, 0) report an error

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
This commit is contained in:
Zhijux Fan
2018-12-16 15:19:42 +08:00
committed by Feng, Bob C
parent 56ad03a5dc
commit 1590d12315
4 changed files with 20 additions and 3 deletions

View File

@ -39,6 +39,7 @@ from Common.Parsing import IsValidWord
from Common.VariableAttributes import VariableAttributes
import Common.GlobalData as GlobalData
import subprocess
from functools import reduce
from Common.Misc import SaveFileOnChange
from Workspace.BuildClassObject import PlatformBuildClassObject, StructurePcd, PcdClassObject, ModuleBuildClassObject
from collections import OrderedDict, defaultdict
@ -1928,7 +1929,7 @@ class DscBuildData(PlatformBuildClassObject):
if index:
indicator = "(Pcd"
if len(pcd_capacity)>2:
for i in xrange(0,len(index_elements)):
for i in range(0,len(index_elements)):
index_ele = index_elements[i]
index_num = index_ele.strip("[").strip("]").strip()
if i == len(index_elements) -2: