Skip to content
This repository was archived by the owner on Apr 14, 2024. It is now read-only.

Commit ebf1ead

Browse files
committed
stream: adjusted code to allow compilation in python 2.4. It doesn't work though as the mmap implementation isn't advanced enough, but parent projects can at least import gitdb, and possibly use different implementations on demand
1 parent f534e6e commit ebf1ead

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

ext/async

Submodule async updated from 0819784 to 2842d1e

stream.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ def compressed_bytes_read(self):
167167

168168
#} END interface
169169

170-
def seek(self, offset, whence=os.SEEK_SET):
170+
def seek(self, offset, whence=getattr(os, 'SEEK_SET', 0)):
171171
"""Allows to reset the stream to restart reading
172172
:raise ValueError: If offset and whence are not 0"""
173173
if offset != 0 or whence != os.SEEK_SET:
@@ -407,7 +407,7 @@ def read(self, count=0):
407407
self._br += len(data)
408408
return data
409409

410-
def seek(self, offset, whence=os.SEEK_SET):
410+
def seek(self, offset, whence=getattr(os, 'SEEK_SET', 0)):
411411
"""Allows to reset the stream to restart reading
412412
413413
:raise ValueError: If offset and whence are not 0"""
@@ -517,7 +517,7 @@ def write(self, data):
517517
def close(self):
518518
self.buf.write(self.zip.flush())
519519

520-
def seek(self, offset, whence=os.SEEK_SET):
520+
def seek(self, offset, whence=getattr(os, 'SEEK_SET', 0)):
521521
"""Seeking currently only supports to rewind written data
522522
Multiple writes are not supported"""
523523
if offset != 0 or whence != os.SEEK_SET:

0 commit comments

Comments
 (0)