Loader which handles sourceless file imports.
| 977 | |
| 978 | |
| 979 | class SourcelessFileLoader(FileLoader, _LoaderBasics): |
| 980 | |
| 981 | """Loader which handles sourceless file imports.""" |
| 982 | |
| 983 | def get_code(self, fullname): |
| 984 | path = self.get_filename(fullname) |
| 985 | data = self.get_data(path) |
| 986 | # Call _classify_pyc to do basic validation of the pyc but ignore the |
| 987 | # result. There's no source to check against. |
| 988 | exc_details = { |
| 989 | 'name': fullname, |
| 990 | 'path': path, |
| 991 | } |
| 992 | _classify_pyc(data, fullname, exc_details) |
| 993 | return _compile_bytecode( |
| 994 | memoryview(data)[16:], |
| 995 | name=fullname, |
| 996 | bytecode_path=path, |
| 997 | ) |
| 998 | |
| 999 | def get_source(self, fullname): |
| 1000 | """Return None as there is no source code.""" |
| 1001 | return None |
| 1002 | |
| 1003 | |
| 1004 | class ExtensionFileLoader(FileLoader, _LoaderBasics): |
no outgoing calls
no test coverage detected
searching dependent graphs…