Skip to content

Commit

Permalink
windows-related fix
Browse files Browse the repository at this point in the history
  • Loading branch information
spderosso committed Dec 10, 2016
1 parent 9e31a46 commit d948e16
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions gitless/cli/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,10 @@ def get_branch_or_use_upstream(branch_name, arg, repo):

def page(fp, repo):
if not sys.stdout.isatty(): # we are being piped or redirected
# Prevent Python from throwing exceptions on SIGPIPE
from signal import signal, SIGPIPE, SIG_DFL
signal(SIGPIPE, SIG_DFL)
if sys.platform != 'win32':
# Prevent Python from throwing exceptions on SIGPIPE
from signal import signal, SIGPIPE, SIG_DFL
signal(SIGPIPE, SIG_DFL)
# memory-friendly way to output contents of file to stdout
with open(fp, 'r') as f:
shutil.copyfileobj(f, sys.stdout)
Expand Down

0 comments on commit d948e16

Please sign in to comment.