By these 2 reason,
1. Python output run time error to standard error.
2. Some BIOS standard error is not the same as standard output.
We can use try ... exception for output error to standard output
print traceback.format_exc()
Sample code
import traceback
import EfiPy
from EfiPy.MdePkg.Protocol.SimpleTextOut import \
gEfiSimpleTextOutProtocolGuid, \
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
try:
Status = EfiPy.gBS.LocateProtocol (
EfiPy.byref (gEfiSimpleTextOutProtocolGuid),
None,
EfiPy.byref (Interface)
)
except:
print "Exception Test"
print traceback.format_exc()
Due to variable Interface is not initialed before EfiPy.gBS.LocateProtocol, it is exception.
screenshot
No comments:
Post a Comment