BaseTools:PackageDocumentTools import lib error occurs.

Steps:
 1. Download edk2 tree
 2. Build BaseTools
 3. Go to edk2\BaseTools\Scripts\PackageDocumentTools
    to run packagedoc_cli.py

An error occurs if relative imports are used when running
a file alone

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
This commit is contained in:
Fan, ZhijuX
2019-02-25 13:13:20 +08:00
committed by Feng, Bob C
parent dc082d5029
commit 9ab4ec5188
9 changed files with 26 additions and 26 deletions

View File

@ -25,7 +25,7 @@ class BaseINIFile(object):
@return: instance of this class
"""
if len(args) == 0: return object.__new__(cls, *args, **kwargs)
if len(args) == 0: return object.__new__(cls)
filename = args[0]
parent = None
if len(args) > 1:
@ -33,7 +33,7 @@ class BaseINIFile(object):
key = os.path.normpath(filename)
if key not in cls._objs.keys():
cls._objs[key] = object.__new__(cls, *args, **kwargs)
cls._objs[key] = object.__new__(cls)
if parent is not None:
cls._objs[key].AddParent(parent)