Fix exit status codes to be 0-based.

This commit is contained in:
Florian Bruhin 2015-06-04 15:13:20 +02:00
parent e780efb3d9
commit 9ec6e6da80
3 changed files with 8 additions and 1 deletions

View File

@ -81,6 +81,7 @@ Fixed
- Fixed handling of keybindings containing Ctrl/Meta on OS X.
- Fixed crash when downloading an URL without filename (e.g. magnet links) via "Save as...".
- Fixed exception when starting qutebrowser with `:set` as argument.
- Fixed exit status codes (successful exit was 1 instead of 0).
https://github.com/The-Compiler/qutebrowser/releases/tag/v0.2.1[v0.2.1]
-----------------------------------------------------------------------

View File

@ -242,7 +242,7 @@ Completion = enum('Completion', ['command', 'section', 'option', 'value',
# Exit statuses for errors. Needs to be an int for sys.exit.
Exit = enum('Exit', ['ok', 'reserved', 'exception', 'err_ipc', 'err_init',
'err_config', 'err_key_config'], is_int=True)
'err_config', 'err_key_config'], is_int=True, start=0)
class Question(QObject):

View File

@ -54,3 +54,9 @@ def test_start():
e = usertypes.enum('Enum', ['three', 'four'], start=3)
assert e.three.value == 3
assert e.four.value == 4
def test_exit():
"""Make sure the exit status enum is correct."""
assert usertypes.Exit.ok == 0
assert usertypes.Exit.reserved == 1