Skip to content

Commit

Permalink
Fix two bugs with pv_command()
Browse files Browse the repository at this point in the history
1. Provide default value as argument
2. Return tuple rather than string

No unit tests because I’m not sure how to test this
  • Loading branch information
Didion, John (NIH/NHGRI) [F] committed Nov 2, 2016
1 parent ed75bf6 commit 1802b94
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions xphyle/progress.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ def wrap(itr, size=None):
return wrapper(itr, size)
return itr

def pv_command(): # pragma: no-cover
def pv_command(pv=None): # pragma: no-cover
if pv is None:
pv = get_executable_path('pv')
if pv is None:
raise IOError("pv is not available on the path")
check_path(pv, 'f', 'x')
return "{} -pre".format(pv)
return (pv, "-pre")

def wrap_subprocess(cmd, stdin, stdout, **kwargs): # pragma: no-cover
global system_wrapper
Expand Down

0 comments on commit 1802b94

Please sign in to comment.