(self)
| 68 | return fp.read() |
| 69 | |
| 70 | def python_script(self): |
| 71 | # type: () -> Optional[ast.AST] |
| 72 | path = self._maybe_extract() |
| 73 | if not is_python_script(path, check_executable=False): |
| 74 | return None |
| 75 | |
| 76 | return cast( |
| 77 | ast.AST, |
| 78 | compile(self.read_contents(path_hint=path), path, "exec", flags=0, dont_inherit=1), |
| 79 | ) |
| 80 | |
| 81 | def _maybe_extract(self): |
| 82 | # type: () -> str |
no test coverage detected