(self)
| 101 | self._file_openers = {None: io.open} |
| 102 | |
| 103 | def _load(self): |
| 104 | if self._loaded: |
| 105 | return |
| 106 | |
| 107 | try: |
| 108 | import bz2 |
| 109 | self._file_openers[".bz2"] = bz2.open |
| 110 | except ImportError: |
| 111 | pass |
| 112 | |
| 113 | try: |
| 114 | import gzip |
| 115 | self._file_openers[".gz"] = gzip.open |
| 116 | except ImportError: |
| 117 | pass |
| 118 | |
| 119 | try: |
| 120 | import lzma |
| 121 | self._file_openers[".xz"] = lzma.open |
| 122 | self._file_openers[".lzma"] = lzma.open |
| 123 | except (ImportError, AttributeError): |
| 124 | # There are incompatible backports of lzma that do not have the |
| 125 | # lzma.open attribute, so catch that as well as ImportError. |
| 126 | pass |
| 127 | |
| 128 | self._loaded = True |
| 129 | |
| 130 | def keys(self): |
| 131 | """ |
no outgoing calls
no test coverage detected