diff options
| author | Marc Abramowitz <msabramo@gmail.com> | 2014-06-16 09:41:22 -0700 |
|---|---|---|
| committer | Marc Abramowitz <msabramo@gmail.com> | 2014-06-16 09:41:22 -0700 |
| commit | 04b2c8e0025e910010b49fd076327b869fcb859b (patch) | |
| tree | 7f56b57f1ef921e64c9fa2595764cb05bf9effac | |
| parent | a00117481ae16124db6f160121722b88dc507412 (diff) | |
| parent | 33e6314941572a93b8031b1feecded22ef1f5f3c (diff) | |
| download | smmap-04b2c8e0025e910010b49fd076327b869fcb859b.tar.gz | |
Merge pull request #13 from Byron/use_bytes_instead_of_str
Use bytes() instead of str()
| -rw-r--r-- | smmap/buf.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/smmap/buf.py b/smmap/buf.py index 3917ee8..ba6f8ed 100644 --- a/smmap/buf.py +++ b/smmap/buf.py @@ -5,6 +5,12 @@ import sys __all__ = ["SlidingWindowMapBuffer"] +try: + bytes +except NameError: + bytes = str + + class SlidingWindowMapBuffer(object): """A buffer like object which allows direct byte-wise object and slicing into memory of a mapped file. The mapping is controlled by the provided cursor. @@ -73,7 +79,7 @@ class SlidingWindowMapBuffer(object): ofs = i # Keeping tokens in a list could possible be faster, but the list # overhead outweighs the benefits (tested) ! - md = str() + md = bytes() while l: c.use_region(ofs, l) assert c.is_valid() |
