Skip to content

Commit

Permalink
Merge pull request #210 from andredias/release-1.10
Browse files Browse the repository at this point in the history
ok_code now accepts python3 range and anything that has a __contains__ m...
  • Loading branch information
chaosbot committed Dec 23, 2014
2 parents 4f33312 + 9fb7495 commit 0f8b364
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion sh.py
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ def __call__(self, *args, **kwargs):
tmp_call_args, kwargs = self._extract_call_args(kwargs, self._partial_call_args)
call_args.update(tmp_call_args)

if not isinstance(call_args["ok_code"], (tuple, list)):
if not getattr(call_args["ok_code"], '__contains__', None):
call_args["ok_code"] = [call_args["ok_code"]]


Expand Down
1 change: 1 addition & 0 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ def test_ok_code(self):

ls("/aofwje/garogjao4a/eoan3on", _ok_code=code_to_pass)
ls("/aofwje/garogjao4a/eoan3on", _ok_code=[code_to_pass])
ls("/aofwje/garogjao4a/eoan3on", _ok_code=range(code_to_pass + 1))

def test_quote_escaping(self):
py = create_tmp_test("""
Expand Down

0 comments on commit 0f8b364

Please sign in to comment.