(line, encoding)
| 386 | return b'' |
| 387 | |
| 388 | def check(line, encoding): |
| 389 | # Check if the line matches the encoding. |
| 390 | if 0 in line: |
| 391 | raise SyntaxError("source code cannot contain null bytes") |
| 392 | try: |
| 393 | line.decode(encoding) |
| 394 | except UnicodeDecodeError: |
| 395 | msg = "invalid or missing encoding declaration" |
| 396 | if filename is not None: |
| 397 | msg = '{} for {!r}'.format(msg, filename) |
| 398 | raise SyntaxError(msg) |
| 399 | |
| 400 | def find_cookie(line): |
| 401 | match = cookie_re.match(line) |
no test coverage detected
searching dependent graphs…