diff --git a/coala b/coala
index eb9623480b..df7780640b 100755
--- a/coala
+++ b/coala
@@ -13,7 +13,9 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see .
+import sys
+
from coalib.coala import main
if __name__ == "__main__":
- main()
+ sys.exit(main())
diff --git a/coala.py b/coala.py
index eb9623480b..df7780640b 100755
--- a/coala.py
+++ b/coala.py
@@ -13,7 +13,9 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see .
+import sys
+
from coalib.coala import main
if __name__ == "__main__":
- main()
+ sys.exit(main())
diff --git a/coalib/coala.py b/coalib/coala.py
index 579684fea4..255361e57e 100644
--- a/coalib/coala.py
+++ b/coalib/coala.py
@@ -75,8 +75,8 @@ def main():
if interactor is not None and isinstance(interactor, ClosableObject):
interactor.close()
- exit(exitcode)
+ return exitcode
if __name__ == "__main__":
- main()
+ sys.exit(main())