summaryrefslogtreecommitdiff
path: root/__init__.py
diff options
context:
space:
mode:
authorIan Clatworthy <ian.clatworthy@internode.on.net>2009-03-04 15:07:37 +1000
committerIan Clatworthy <ian.clatworthy@internode.on.net>2009-03-04 15:07:37 +1000
commite389be9c476d1f53dc51802d478451630364edad (patch)
treec74c433e5d1b1d6509f2516150f6f80581565c6f /__init__.py
parent4aa805c8cb825688253ebeccf65088beecb332ff (diff)
downloadbzr-fastimport-e389be9c476d1f53dc51802d478451630364edad.tar.gz
make sure fast-export uses a binary stream on Windows
Diffstat (limited to '__init__.py')
-rw-r--r--__init__.py13
1 files changed, 1 insertions, 12 deletions
diff --git a/__init__.py b/__init__.py
index eb31d1a..c7a0f2d 100644
--- a/__init__.py
+++ b/__init__.py
@@ -67,18 +67,7 @@ def _run(source, processor_factory, control, params, verbose):
import parser
if source == '-':
import sys
- stream = sys.stdin
- try:
- import os
- if os.name == 'nt':
- fileno = getattr(sys.stdin, 'fileno', None)
- if fileno:
- no = fileno()
- if no >= 0: # -1 means we're working as subprocess
- import msvcrt
- msvcrt.setmode(no, os.O_BINARY)
- except ImportError:
- pass
+ stream = helpers.binary_stream(sys.stdin)
else:
stream = open(source, "rb")
proc = processor_factory(control, params=params, verbose=verbose)