From db42353587f48f3885f55f1998e4cabbb4c359e2 Mon Sep 17 00:00:00 2001 From: Shaun McCance Date: Sat, 26 Dec 2020 15:50:32 -0500 Subject: 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. --- itstool.in | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/itstool.in b/itstool.in index 395fddf..c21ad4b 100755 --- a/itstool.in +++ b/itstool.in @@ -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 [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() -- cgit v1.2.1