Compatibility Class Used to work around importlib.util.module_from_spec() not being available.
| 49 | return file.read() |
| 50 | |
| 51 | class CustomLoader( FileLoader, SourceLoader ): |
| 52 | ''' |
| 53 | Compatibility Class |
| 54 | Used to work around importlib.util.module_from_spec() not being available. |
| 55 | ''' |
| 56 | def get_code( self, fullname ): |
| 57 | source = self.get_source( fullname ) |
| 58 | path = self.get_filename( fullname ) |
| 59 | parsed = ast.parse( source ) |
| 60 | return compile( parsed, path, 'exec', dont_inherit=True, optimize=0 ) |
| 61 | |
| 62 | |
| 63 |
no outgoing calls
no test coverage detected
searching dependent graphs…