Skip to content

Commit

Permalink
regression bugfix for ok code none #344
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Moffat committed Dec 2, 2016
1 parent 1584fbe commit 813162b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Changelog

## 1.12.6 - 11/32/16
## 1.12.6 - 12/02/16

* regression bugfix on timeout [#344](https://github.com/amoffat/sh/issues/344)
* regression bugfix on `_ok_code=None`

## 1.12.5 - 12/01/16

Expand Down
7 changes: 7 additions & 0 deletions sh.py
Original file line number Diff line number Diff line change
Expand Up @@ -1186,6 +1186,13 @@ def __call__(self, *args, **kwargs):
call_args.update(extracted_call_args)


# handle a None. this is added back only to not break the api in the
# 1.* version. TODO remove this in 2.0, as "ok_code", if specified,
# should always be a definitive value or list of values, and None is
# ambiguous
if call_args["ok_code"] is None:
call_args["ok_code"] = 0

if not getattr(call_args["ok_code"], "__iter__", None):
call_args["ok_code"] = [call_args["ok_code"]]

Expand Down

0 comments on commit 813162b

Please sign in to comment.