Код: Выделить всё
import os
import sys
import glob
import re
...
def read_busclass_files(rule_blocks: dict[str, RuleBlocks]):
...
for file_path in matching_files:
try:
...
if (action_info is not None):
class_map[class_name].actions[action_name] = action_info
# print (f"{file_path} done.")
except IOError as e:
print(f"Error reading file {file_path}: {e}")
return class_map
...
def main():
...
class_map = read_busclass_files(rule_blocks)
...
return 0
if __name__ == "__main__":
exit(main())
Когда я запускаю скрипт в отладчике, выполнение останавливается на строке for с такой ошибкой:
Код: Выделить всё
Exception has occurred: TypeError
an integer is required
File "C:\landmark\ox1\src\hcm\scripts\ValidateInvokes.py", line 275, in read_busclass_files
for file_path in matching_files:
File "C:\landmark\ox1\src\hcm\scripts\ValidateInvokes.py", line 512, in main
class_map = read_busclass_files(rule_blocks)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\landmark\ox1\src\hcm\scripts\ValidateInvokes.py", line 522, in
exit(main())
^^^^^^
TypeError: an integer is required
Подробнее здесь: https://stackoverflow.com/questions/791 ... h-if-block
Мобильная версия