# HG changeset patch # User Alain Mazy # Date 1694009356 -7200 # Node ID 31bfa492311e5f89fcbcf3c79744b11615649a45 # Parent 33410f14033b6b7e6d76d97acadd36dc17c3f01e GenerateErrorCodes.py now works with python3 diff -r 33410f14033b -r 31bfa492311e OrthancFramework/Resources/CodeGeneration/GenerateErrorCodes.py --- a/OrthancFramework/Resources/CodeGeneration/GenerateErrorCodes.py Wed Sep 06 15:57:11 2023 +0200 +++ b/OrthancFramework/Resources/CodeGeneration/GenerateErrorCodes.py Wed Sep 06 16:09:16 2023 +0200 @@ -122,7 +122,7 @@ with open(path, 'r') as f: a = f.read() -e = filter(lambda x: 'SQLite' in x and x['SQLite'], ERRORS) +e = list(filter(lambda x: 'SQLite' in x and x['SQLite'], ERRORS)) s = ',\n'.join(map(lambda x: ' ErrorCode_%s' % x['Name'], e)) a = re.sub('(enum ErrorCode\s*{)[^}]*?(\s*};)', r'\1\n%s\2' % s, a, re.DOTALL)