diff options
author | Pierre Gondois <pierre.gondois@arm.com> | 2025-04-30 11:06:21 +0300 |
---|---|---|
committer | Liming Gao <gaoliming@byosoft.com.cn> | 2025-07-01 04:51:38 +0300 |
commit | c169a5420b25f6e95e1ca8223051aade870f0d03 (patch) | |
tree | 60c26ad8659ed89cbe6b7e9adacdece017f22b47 /BaseTools/Source/Python/UPT/Library/UniClassObject.py | |
parent | f54fe78d9a1a760bdfd50131221cb93916ce5865 (diff) | |
download | edk2-c169a5420b25f6e95e1ca8223051aade870f0d03.tar.xz |
BaseTools: Remove unreachable code
Running the vulture tool gave the following report.
Remove the unreachable code.
- TargetTool/TargetTool.py:49:
unreachable code after 'raise' (100% confidence)
- UPT/Library/UniClassObject.py:137:
unreachable code after 'return' (100% confidence)
- UPT/Object/Parser/InfDefineObject.py:795:
unreachable code after 'if' (100% confidence)
- Ecc/Check.py:1504:
unreachable code after 'return' (100% confidence)
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
Diffstat (limited to 'BaseTools/Source/Python/UPT/Library/UniClassObject.py')
-rw-r--r-- | BaseTools/Source/Python/UPT/Library/UniClassObject.py | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/BaseTools/Source/Python/UPT/Library/UniClassObject.py b/BaseTools/Source/Python/UPT/Library/UniClassObject.py index 381f978cfe..80924a6f2a 100644 --- a/BaseTools/Source/Python/UPT/Library/UniClassObject.py +++ b/BaseTools/Source/Python/UPT/Library/UniClassObject.py @@ -133,40 +133,6 @@ def ConvertSpecialUnicodes(Uni): def GetLanguageCode1766(LangName, File=None):
return LangName
- length = len(LangName)
- if length == 2:
- if LangName.isalpha():
- for Key in gLANG_CONV_TABLE.keys():
- if gLANG_CONV_TABLE.get(Key) == LangName.lower():
- return Key
- elif length == 3:
- if LangName.isalpha() and gLANG_CONV_TABLE.get(LangName.lower()):
- return LangName
- else:
- EdkLogger.Error("Unicode File Parser",
- ToolError.FORMAT_INVALID,
- "Invalid RFC 1766 language code : %s" % LangName,
- File)
- elif length == 5:
- if LangName[0:2].isalpha() and LangName[2] == '-':
- for Key in gLANG_CONV_TABLE.keys():
- if gLANG_CONV_TABLE.get(Key) == LangName[0:2].lower():
- return Key
- elif length >= 6:
- if LangName[0:2].isalpha() and LangName[2] == '-':
- for Key in gLANG_CONV_TABLE.keys():
- if gLANG_CONV_TABLE.get(Key) == LangName[0:2].lower():
- return Key
- if LangName[0:3].isalpha() and gLANG_CONV_TABLE.get(LangName.lower()) is None and LangName[3] == '-':
- for Key in gLANG_CONV_TABLE.keys():
- if Key == LangName[0:3].lower():
- return Key
-
- EdkLogger.Error("Unicode File Parser",
- ToolError.FORMAT_INVALID,
- "Invalid RFC 4646 language code : %s" % LangName,
- File)
-
## GetLanguageCode
#
# Check the language code read from .UNI file and convert RFC 1766 codes to RFC 4646 codes if appropriate
|