Show More
@@ -238,10 +238,14 b' try:' | |||||
238 | buffer = buffer |
|
238 | buffer = buffer | |
239 | except NameError: |
|
239 | except NameError: | |
240 | if not pycompat.ispy3: |
|
240 | if not pycompat.ispy3: | |
241 | def buffer(sliceable, offset=0): |
|
241 | def buffer(sliceable, offset=0, length=None): | |
|
242 | if length is not None: | |||
|
243 | return sliceable[offset:offset + length] | |||
242 | return sliceable[offset:] |
|
244 | return sliceable[offset:] | |
243 | else: |
|
245 | else: | |
244 | def buffer(sliceable, offset=0): |
|
246 | def buffer(sliceable, offset=0, length=None): | |
|
247 | if length is not None: | |||
|
248 | return memoryview(sliceable)[offset:offset + length] | |||
245 | return memoryview(sliceable)[offset:] |
|
249 | return memoryview(sliceable)[offset:] | |
246 |
|
250 | |||
247 | closefds = pycompat.osname == 'posix' |
|
251 | closefds = pycompat.osname == 'posix' |
General Comments 0
You need to be logged in to leave comments.
Login now