summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShaun McCance <shaunm@redhat.com>2020-12-26 15:50:32 -0500
committerShaun McCance <shaunm@redhat.com>2020-12-26 15:50:32 -0500
commitdb42353587f48f3885f55f1998e4cabbb4c359e2 (patch)
tree2cd9741f333648dabbb3b26f2ef2e615875f944a
parentdecbd0e50e824ee0241b36c07c5652b1af47ff20 (diff)
downloaditstool-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-xitstool.in15
1 files 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 <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()