Mercurial > hg > orthanc
diff OrthancFramework/Resources/CodeGeneration/GenerateErrorCodes.py @ 5384:31bfa492311e
GenerateErrorCodes.py now works with python3
author | Alain Mazy <am@osimis.io> |
---|---|
date | Wed, 06 Sep 2023 16:09:16 +0200 |
parents | 0ea402b4d901 |
children | 48b8dae6dc77 |
line wrap: on
line diff
--- 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)