This repository was archived by the owner on Apr 14, 2024. It is now read-only.
File tree 2 files changed +13
-3
lines changed
2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 12
12
install :
13
13
- pip install coveralls
14
14
script :
15
+ - ulimit -n 48
16
+ - ulimit -n
15
17
- nosetests -v --with-coverage
16
18
after_success :
17
19
- coveralls
Original file line number Diff line number Diff line change @@ -91,9 +91,7 @@ def _set_cache_(self, attr):
91
91
self ._parse_header_info ()
92
92
93
93
def __del__ (self ):
94
- if self ._close :
95
- self ._m .close ()
96
- # END handle resource freeing
94
+ self .close ()
97
95
98
96
def _parse_header_info (self ):
99
97
"""If this stream contains object data, parse the header info and skip the
@@ -141,6 +139,16 @@ def data(self):
141
139
""":return: random access compatible data we are working on"""
142
140
return self ._m
143
141
142
+ def close (self ):
143
+ """Close our underlying stream of compressed bytes if this was allowed during initialization
144
+ :return: True if we closed the underlying stream
145
+ :note: can be called safely
146
+ """
147
+ if self ._close :
148
+ self ._m .close ()
149
+ self ._close = False
150
+ # END handle resource freeing
151
+
144
152
def compressed_bytes_read (self ):
145
153
"""
146
154
:return: number of compressed bytes read. This includes the bytes it
You can’t perform that action at this time.
0 commit comments