mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-04-02 16:21:20 +00:00
Remove unnecessary try/catch in list_internal_identifiers
The try/catch was used to catch Exceptions and exit with code 1, a legacy from check_names.py which uses the pattern to exit with code 2. But code 1 is the default for the Python runtime anyway, so it is redundant and can be removed. Signed-off-by: Yuto Takano <yuto.takano@arm.com>
This commit is contained in:
parent
8246eb8fb6
commit
165700c914
@ -44,21 +44,16 @@ def main():
|
|||||||
|
|
||||||
parser.parse_args()
|
parser.parse_args()
|
||||||
|
|
||||||
try:
|
name_check = CodeParser(logging.getLogger())
|
||||||
name_check = CodeParser(logging.getLogger())
|
result = name_check.parse_identifiers([
|
||||||
result = name_check.parse_identifiers([
|
"include/mbedtls/*_internal.h",
|
||||||
"include/mbedtls/*_internal.h",
|
"library/*.h"
|
||||||
"library/*.h"
|
])
|
||||||
])
|
result.sort(key=lambda x: x.name)
|
||||||
result.sort(key=lambda x: x.name)
|
|
||||||
|
|
||||||
identifiers = ["{}\n".format(match.name) for match in result]
|
identifiers = ["{}\n".format(match.name) for match in result]
|
||||||
with open("identifiers", "w", encoding="utf-8") as f:
|
with open("identifiers", "w", encoding="utf-8") as f:
|
||||||
f.writelines(identifiers)
|
f.writelines(identifiers)
|
||||||
|
|
||||||
except Exception: # pylint: disable=broad-except
|
|
||||||
traceback.print_exc()
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user