diff options
author | Shaun McCance <shaunm@redhat.com> | 2020-12-26 15:50:32 -0500 |
---|---|---|
committer | Shaun McCance <shaunm@redhat.com> | 2020-12-26 15:50:32 -0500 |
commit | db42353587f48f3885f55f1998e4cabbb4c359e2 (patch) | |
tree | 2cd9741f333648dabbb3b26f2ef2e615875f944a | |
parent | decbd0e50e824ee0241b36c07c5652b1af47ff20 (diff) | |
download | itstool-db42353587f48f3885f55f1998e4cabbb4c359e2.tar.gz |
Fix errors from accidental global variable removal
In a recent commit for profiling, I moved the __main__ code to a main()
function. This broke some stuff that relied on an accidentally global
variable. Now the variable gets passed as a param, as it should.
-rwxr-xr-x | itstool.in | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -1495,7 +1495,8 @@ def convert_locale (locale): return ret -def main(): +#def main(): +if __name__ == '__main__': options = optparse.OptionParser() options.set_usage('\n itstool [OPTIONS] [XMLFILES]\n' + ' itstool -m <MOFILE> [OPTIONS] [XMLFILES]\n' + @@ -1682,9 +1683,9 @@ def main(): out.write(serialized) out.flush() -if __name__ == '__main__': - if os.getenv('ITSTOOL_PROFILE') is not None: - import cProfile - cProfile.run('main()') - else: - main() +#if __name__ == '__main__': +# if os.getenv('ITSTOOL_PROFILE') is not None: +# import cProfile +# cProfile.run('main()') +# else: +# main() |