(path)
| 152 | |
| 153 | |
| 154 | def get_encoding(path): |
| 155 | try: |
| 156 | with open(path, "rb") as fd: |
| 157 | if sys.version_info.major == 2: |
| 158 | return find_encoding_py2(fd.readline) |
| 159 | return tokenize.detect_encoding(fd.readline)[0] |
| 160 | except SyntaxError: |
| 161 | return "utf-8" |
| 162 | |
| 163 | |
| 164 | def get_environment(): |
no test coverage detected