diff --git a/scuba/__main__.py b/scuba/__main__.py
index <HASH>..<HASH> 100644
--- a/scuba/__main__.py
+++ b/scuba/__main__.py
@@ -387,7 +387,7 @@ def main(argv=None):
     scuba_args = parse_scuba_args(argv)
 
     try:
-        rc = run_scuba(scuba_args)
+        rc = run_scuba(scuba_args) or 0
         sys.exit(rc)
     except ScubaError as e:
         appmsg(str(e))
diff --git a/tests/test_main.py b/tests/test_main.py
index <HASH>..<HASH> 100644
--- a/tests/test_main.py
+++ b/tests/test_main.py
@@ -76,7 +76,7 @@ class TestMain(TestCase):
                         try:
                             main.main(argv = args)
                         except SystemExit as sysexit:
-                            retcode = sysexit.args[0]
+                            retcode = sysexit.code
                         else:
                             retcode = 0
scuba: Ensure scuba always exits with integer exit code

Also, use SystemExit.code instead of .args[0].