|
@@ -27,6 +27,9 @@ from dulwich.errors import (
|
|
|
HangupException,
|
|
|
GitProtocolError,
|
|
|
)
|
|
|
+from dulwich.misc import (
|
|
|
+ SEEK_END,
|
|
|
+ )
|
|
|
|
|
|
TCP_GIT_PORT = 9418
|
|
|
|
|
@@ -193,7 +196,7 @@ class ReceivableProtocol(Protocol):
|
|
|
# - omit the size <= 0 branch
|
|
|
# - seek back to start rather than 0 in case some buffer has been
|
|
|
# consumed.
|
|
|
- # - use os.SEEK_END instead of the magic number.
|
|
|
+ # - use SEEK_END instead of the magic number.
|
|
|
# Copyright (c) 2001-2010 Python Software Foundation; All Rights Reserved
|
|
|
# Licensed under the Python Software Foundation License.
|
|
|
# TODO: see if buffer is more efficient than cStringIO.
|
|
@@ -204,7 +207,7 @@ class ReceivableProtocol(Protocol):
|
|
|
# rbufsize is large compared to the typical return value of recv().
|
|
|
buf = self._rbuf
|
|
|
start = buf.tell()
|
|
|
- buf.seek(0, os.SEEK_END)
|
|
|
+ buf.seek(0, SEEK_END)
|
|
|
# buffer may have been partially consumed by recv()
|
|
|
buf_len = buf.tell() - start
|
|
|
if buf_len >= size:
|
|
@@ -252,7 +255,7 @@ class ReceivableProtocol(Protocol):
|
|
|
|
|
|
buf = self._rbuf
|
|
|
start = buf.tell()
|
|
|
- buf.seek(0, os.SEEK_END)
|
|
|
+ buf.seek(0, SEEK_END)
|
|
|
buf_len = buf.tell()
|
|
|
buf.seek(start)
|
|
|
|