diff options
author | lloyd <[email protected]> | 2015-04-12 04:05:56 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2015-04-12 04:05:56 +0000 |
commit | 8188ace872781c5ed6f6d27dad987bed4c8bd40a (patch) | |
tree | 76aad760688e1cfbdefeadb368506ae9f926f2cb | |
parent | 6e2bf7b795a0f1a9731f23ec4fa69a3e4e716cdb (diff) |
Remove notice loglevel as logging.addLevelName is broken in Python3
Read and write the amalgamation as latin1 so python3 treats it as just bits
instead of invalid UTF8
-rwxr-xr-x | configure.py | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/configure.py b/configure.py index 135addbd4..637520dd0 100755 --- a/configure.py +++ b/configure.py @@ -40,8 +40,6 @@ if 'dont_write_bytecode' in sys.__dict__: import botan_version -NOTICE_LOGLEVEL = 25 - def flatten(l): return sum(l, []) @@ -1638,7 +1636,7 @@ def generate_amalgamation(build_config, options): header_name = '%s.h' % (amalg_basename) header_int_name = '%s_internal.h' % (amalg_basename) - logging.log(NOTICE_LOGLEVEL, 'Writing amalgamation header to %s' % (header_name)) + logging.info('Writing amalgamation header to %s' % (header_name)) botan_h = open(header_name, 'w') botan_int_h = open(header_int_name, 'w') @@ -1685,8 +1683,8 @@ def generate_amalgamation(build_config, options): def open_amalg_file(tgt): fsname = '%s%s.cpp' % (amalg_basename, '_' + tgt if tgt else '' ) botan_amalgs_fs.append(fsname) - logging.log(NOTICE_LOGLEVEL, 'Writing amalgamation source to %s' % (fsname)) - f = open(fsname, 'w') + logging.info('Writing amalgamation source to %s' % (fsname)) + f = open(fsname, 'w', encoding='latin1') f.write(amalg_header) f.write('\n#include "%s"\n' % (header_name)) @@ -1708,7 +1706,7 @@ def generate_amalgamation(build_config, options): if tgt not in botan_amalgs: botan_amalgs[tgt] = open_amalg_file(tgt) for src in sorted(mod.source): - contents = open(src).readlines() + contents = open(src, encoding='latin1').readlines() for line in contents: if botan_include.search(line): continue @@ -1760,8 +1758,6 @@ def main(argv = None): logging.basicConfig(stream = sys.stdout, format = '%(levelname) 7s: %(message)s') - logging.addLevelName('NOTICE', NOTICE_LOGLEVEL) - options = process_command_line(argv[1:]) def log_level(): @@ -1886,7 +1882,7 @@ def main(argv = None): for m in loaded_mods: if modules[m].load_on == 'vendor': - logging.log(NOTICE_LOGLEVEL, 'Enabling use of external dependency %s' % (m)) + logging.info('Enabling use of external dependency %s' % (m)) if not osinfo.build_shared: if options.build_shared_lib: |