Read and return the contents of a Python source file (as a string), taking into account the file encoding.
(filename)
| 11 | |
| 12 | |
| 13 | def read_pyfile(filename): |
| 14 | """Read and return the contents of a Python source file (as a |
| 15 | string), taking into account the file encoding.""" |
| 16 | with tokenize.open(filename) as stream: |
| 17 | return stream.read() |
| 18 | |
| 19 | |
| 20 | for_else = """\ |
no test coverage detected
searching dependent graphs…