(self, *args, **kwargs)
| 333 | return getattr(file_obj, name) |
| 334 | |
| 335 | def close(self, *args, **kwargs): |
| 336 | if self.closed: |
| 337 | return |
| 338 | if StreamWrapper.debug_unclosed_streams: |
| 339 | del StreamWrapper.session_streams[self] |
| 340 | if hasattr(self, "parent_stream") and self.parent_stream is not None: |
| 341 | self.parent_stream.child_counter -= 1 |
| 342 | if not self.parent_stream.child_counter and self.parent_stream.close_on_last_child: |
| 343 | self.parent_stream.close() |
| 344 | try: |
| 345 | self.file_obj.close(*args, **kwargs) |
| 346 | except AttributeError: |
| 347 | pass |
| 348 | self.closed = True |
| 349 | |
| 350 | def autoclose(self): |
| 351 | """Automatically close stream when all child streams are closed or if there are none.""" |
no outgoing calls
no test coverage detected